| 1 |
// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify |
| 2 |
|
| 3 |
typedef float float2 __attribute__((ext_vector_type(2))); |
| 4 |
typedef float float3 __attribute__((ext_vector_type(3))); |
| 5 |
|
| 6 |
float2 test_no_second_arg(float2 p0) { |
| 7 |
return __builtin_spirv_smoothstep(p0); |
| 8 |
// expected-error@-1 {{too few arguments to function call, expected 3, have 1}} |
| 9 |
} |
| 10 |
|
| 11 |
float2 test_no_third_arg(float2 p0) { |
| 12 |
return __builtin_spirv_smoothstep(p0, p0); |
| 13 |
// expected-error@-1 {{too few arguments to function call, expected 3, have 2}} |
| 14 |
} |
| 15 |
|
| 16 |
float2 test_too_many_arg(float2 p0) { |
| 17 |
return __builtin_spirv_smoothstep(p0, p0, p0, p0); |
| 18 |
// expected-error@-1 {{too many arguments to function call, expected 3, have 4}} |
| 19 |
} |
| 20 |
|
| 21 |
int test_int_scalar_inputs(int p0) { |
| 22 |
return __builtin_spirv_smoothstep(p0, p0, p0); |
| 23 |
// expected-error@-1 {{1st argument must be a scalar or vector of floating-point types (was 'int')}} |
| 24 |
} |
| 25 |
|
| 26 |
float test_int_scalar_inputs2(float p0, int p1) { |
| 27 |
return __builtin_spirv_smoothstep(p0, p1, p1); |
| 28 |
// expected-error@-1 {{all arguments to '__builtin_spirv_smoothstep' must have the same type}} |
| 29 |
} |
| 30 |
|
| 31 |
float test_int_scalar_inputs3(float p0, int p1) { |
| 32 |
return __builtin_spirv_smoothstep(p0, p0, p1); |
| 33 |
// expected-error@-1 {{all arguments to '__builtin_spirv_smoothstep' must have the same type}} |
| 34 |
} |
| 35 |
|
| 36 |
float test_mismatched_arg(float p0, float2 p1) { |
| 37 |
return __builtin_spirv_smoothstep(p0, p1, p1); |
| 38 |
// expected-error@-1 {{all arguments to '__builtin_spirv_smoothstep' must have the same type}} |
| 39 |
} |
| 40 |
|
| 41 |
float test_mismatched_arg2(float p0, float2 p1) { |
| 42 |
return __builtin_spirv_smoothstep(p0, p0, p1); |
| 43 |
// expected-error@-1 {{all arguments to '__builtin_spirv_smoothstep' must have the same type}} |
| 44 |
} |
| 45 |
|
| 46 |
float test_mismatched_return(float2 p0) { |
| 47 |
return __builtin_spirv_smoothstep(p0, p0, p0); |
| 48 |
// expected-error@-1 {{returning 'float2' (vector of 2 'float' values) from a function with incompatible result type 'float'}} |
| 49 |
} |
| 50 |
|
| 51 |
float3 test_mismatched_return2(float2 p0) { |
| 52 |
return __builtin_spirv_smoothstep(p0, p0, p0); |
| 53 |
// expected-error@-1 {{returning 'float2' (vector of 2 'float' values) from a function with incompatible result type 'float3' (vector of 3 'float' values)}} |
| 54 |
} |