brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 4ec1bce Raw
58 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -fnative-int16-type -emit-llvm-only -disable-llvm-passes -verify2 3float test_no_second_arg(float2 p0) {4  return distance(p0);5  // expected-error@-1 {{no matching function for call to 'distance'}}6  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}}7  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}}8  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}}9  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 1 was provided}}10}11 12float test_too_many_arg(float2 p0) {13  return distance(p0, p0, p0);14  // expected-error@-1 {{no matching function for call to 'distance'}}15  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}}16  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}}17  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}}18  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 2 arguments, but 3 were provided}}19}20 21float test_double_inputs(double p0, double p1) {22  return distance(p0, p1);23  // expected-error@-1 {{no matching function for call to 'distance'}}24  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}25  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}26  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}27  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}28}29 30float test_int_inputs(int p0, int p1) {31  return distance(p0, p1);32  // expected-error@-1 {{no matching function for call to 'distance'}}33  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}34  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}35  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}36  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}37}38 39float1 test_vec1_inputs(float1 p0, float1 p1) {40  return distance(p0, p1);41  // expected-error@-1  {{no matching function for call to 'distance'}}42  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, vector<float, 1>>'}}43  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, vector<float, 1>>'}}44  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, half>'}}45  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, float>'}}46}47 48typedef float float5 __attribute__((ext_vector_type(5)));49 50float5 test_vec5_inputs(float5 p0, float5 p1) {51  return distance(p0, p1);52  // expected-error@-1  {{no matching function for call to 'distance'}}53  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, vector<float, 5>>'}}54  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with T = float5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, vector<float, 5>>'}}55  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, half>'}}56  // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with N = 5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, float>'}}57}58