| 1 |
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify |
| 2 |
|
| 3 |
int4 test_too_few_arg() { |
| 4 |
return D3DCOLORtoUBYTE4(); |
| 5 |
// expected-error@-1 {{no matching function for call to 'D3DCOLORtoUBYTE4'}} |
| 6 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'V', but no arguments were provided}} |
| 7 |
} |
| 8 |
|
| 9 |
int4 test_too_many_arg(float4 v) { |
| 10 |
return D3DCOLORtoUBYTE4(v, v); |
| 11 |
// expected-error@-1 {{no matching function for call to 'D3DCOLORtoUBYTE4'}} |
| 12 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires single argument 'V', but 2 arguments were provided}} |
| 13 |
} |
| 14 |
|
| 15 |
int4 float2_arg(float2 v) { |
| 16 |
return D3DCOLORtoUBYTE4(v); |
| 17 |
// expected-error@-1 {{no matching function for call to 'D3DCOLORtoUBYTE4'}} |
| 18 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: no known conversion from 'vector<[...], 2>' to 'vector<[...], 4>' for 1st argument}} |
| 19 |
} |
| 20 |
|
| 21 |
struct S { |
| 22 |
float4 f; |
| 23 |
}; |
| 24 |
|
| 25 |
int4 struct_arg(S v) { |
| 26 |
return D3DCOLORtoUBYTE4(v); |
| 27 |
// expected-error@-1 {{no matching function for call to 'D3DCOLORtoUBYTE4'}} |
| 28 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: no known conversion from 'S' to 'float4' (aka 'vector<float, 4>') for 1st argument}} |
| 29 |
} |