26 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -fnative-int16-type -verify2 3 4int4 test_asint_too_many_arg(float p0, float p1) {5 return asint(p0, p1);6 // expected-error@-1 {{no matching function for call to 'asint'}}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}10 11int test_asint_double(double p1) {12 return asint(p1);13 // expected-error@hlsl/hlsl_intrinsics.h:* {{no matching function for call to 'bit_cast'}}14 // expected-note@-2 {{in instantiation of function template specialization 'hlsl::asint<double>'}}15 // expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: could not match 'vector<double, N>' against 'double'}}16 // expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: substitution failure [with U = int, T = double]: no type named 'Type'}}17}18 19int test_asint_half(half p1) {20 return asint(p1);21 // expected-error@hlsl/hlsl_intrinsics.h:* {{no matching function for call to 'bit_cast'}}22 // expected-note@-2 {{in instantiation of function template specialization 'hlsl::asint<half>'}}23 // expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: could not match 'vector<half, N>' against 'half'}}24 // expected-note@hlsl/hlsl_detail.h:* {{candidate template ignored: substitution failure [with U = int, T = half]: no type named 'Type'}}25}26