brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · e9bf4c9 Raw
30 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify2 3int4 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 9int4 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 15int4 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 21struct S {22  float4 f;23};24 25int4 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}30