| 1 |
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -fnative-int16-type -verify |
| 2 |
|
| 3 |
|
| 4 |
uint4 test_asuint_too_many_arg(float p0, float p1) { |
| 5 |
return asuint(p0, p1); |
| 6 |
// expected-error@-1 {{no matching function for call to 'asuint'}} |
| 7 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'V', but 2 arguments were provided}} |
| 8 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires single argument 'F', but 2 arguments were provided}} |
| 9 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 3 arguments, but 2 were provided}} |
| 10 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 3 arguments, but 2 were provided}} |
| 11 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 3 arguments, but 2 were provided}} |
| 12 |
// expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function not viable: requires 3 arguments, but 2 were provided}} |
| 13 |
} |
| 14 |
|
| 15 |
uint test_asuint_double(double p1) { |
| 16 |
return asuint(p1); |
| 17 |
// expected-error@hlsl/hlsl_intrinsics.h:* {{no matching function for call to 'bit_cast'}} |
| 18 |
// expected-note@-2 {{in instantiation of function template specialization 'hlsl::asuint<double>'}} |
| 19 |
// expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: could not match 'vector<double, N>' against 'double'}} |
| 20 |
// expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: substitution failure [with U = uint, T = double]: no type named 'Type'}} |
| 21 |
} |
| 22 |
|
| 23 |
uint test_asuint_half(half p1) { |
| 24 |
return asuint(p1); |
| 25 |
// expected-error@hlsl/hlsl_intrinsics.h:* {{no matching function for call to 'bit_cast'}} |
| 26 |
// expected-note@-2 {{in instantiation of function template specialization 'hlsl::asuint<half>'}} |
| 27 |
// expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: could not match 'vector<half, N>' against 'half'}} |
| 28 |
// expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: substitution failure [with U = uint, T = half]: no type named 'Type'}} |
| 29 |
} |
| 30 |
|
| 31 |
void test_asuint_first_arg_const(double D) { |
| 32 |
const uint A = 0; |
| 33 |
uint B; |
| 34 |
asuint(D, A, B); |
| 35 |
// expected-error@hlsl/hlsl_intrinsics.h:* {{read-only variable is not assignable}} |
| 36 |
} |
| 37 |
|
| 38 |
void test_asuint_second_arg_const(double D) { |
| 39 |
const uint A = 0; |
| 40 |
uint B; |
| 41 |
asuint(D, B, A); |
| 42 |
// expected-error@hlsl/hlsl_intrinsics.h:* {{read-only variable is not assignable}} |
| 43 |
} |
| 44 |
|
| 45 |
void test_asuint_imidiate_value(double D) { |
| 46 |
uint B; |
| 47 |
asuint(D, B, 1); |
| 48 |
// expected-error@-1 {{cannot bind non-lvalue argument '1' to out paramemter}} |
| 49 |
} |
| 50 |
|
| 51 |
void test_asuint_expr(double D) { |
| 52 |
uint B; |
| 53 |
asuint(D, B, B + 1); |
| 54 |
// expected-error@-1 {{cannot bind non-lvalue argument 'B + 1' to out paramemter}} |
| 55 |
} |