29 lines · plain
1// RUN: %clang_cc1 -finclude-default-header2// -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only3// -disable-llvm-passes -verify4 5double2 test_int_builtin(double2 p0) {6 return __builtin_hlsl_elementwise_countbits(p0);7 // expected-error@-1 {{passing 'double2' (aka 'vector<double, 2>') to8 // parameter of incompatible type9 // '__attribute__((__vector_size__(2 * sizeof(int)))) int'10 // (vector of 2 'int' values)}}11}12 13float test_ambiguous(float p0) {14 return countbits(p0);15 // expected-error@-1 {{call to 'countbits' is ambiguous}}16 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} 17 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}18 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}19 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}} 20 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}21 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function}}22}23 24float test_float_builtin(float p0) {25 return __builtin_hlsl_elementwise_countbits(p0);26 // expected-error@-1 {{passing 'double' to parameter of incompatible type27 // 'int'}}28}29