Debian Codegraph @

clang/test/SemaHLSL/BuiltIns/refract-errors.hlsl

raw
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 -verify
2
3 float test_no_second_arg(float3 p0) {
4 return refract(p0);
5 // expected-error@-1 {{no matching function for call to 'refract'}}
6 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 1 was provided}}
7 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 1 was provided}}
8 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 1 was provided}}
9 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 1 was provided}}
10 }
11
12 float test_no_third_arg(float3 p0) {
13 return refract(p0, p0);
14 // expected-error@-1 {{no matching function for call to 'refract'}}
15 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 2 were provided}}
16 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 2 were provided}}
17 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 2 were provided}}
18 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 2 were provided}}
19 }
20
21 float test_too_many_arg(float2 p0) {
22 return refract(p0, p0, p0, p0);
23 // expected-error@-1 {{no matching function for call to 'refract'}}
24 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 4 were provided}}
25 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 4 were provided}}
26 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 4 were provided}}
27 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate function template not viable: requires 3 arguments, but 4 were provided}}
28 }
29
30 float test_double_inputs(double p0, double p1, double p2) {
31 return refract(p0, p1, p2);
32 // expected-error@-1 {{no matching function for call to 'refract'}}
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
39 float test_int_inputs(int p0, int p1, int p2) {
40 return refract(p0, p1, p2);
41 // expected-error@-1 {{no matching function for call to 'refract'}}
42 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}
43 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}
44 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}
45 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored}}
46 }
47
48 float1 test_vec1_inputs(float1 p0, float1 p1, float1 p2) {
49 return refract(p0, p1, p2);
50 // expected-error@-1 {{no matching function for call to 'refract'}}
51 // 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>>'}}
52 // 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>>'}}
53 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, half>'}}
54 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 1]: no type named 'Type' in 'hlsl::__detail::enable_if<false, float>'}}
55 }
56
57 typedef float float5 __attribute__((ext_vector_type(5)));
58
59 float5 test_vec5_inputs(float5 p0, float5 p1, float p2) {
60 return refract(p0, p1, p2);
61 // expected-error@-1 {{no matching function for call to 'refract'}}
62 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: deduced conflicting types for parameter 'T' ('float5' (vector of 5 'float' values) vs. 'float')}}
63 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: deduced conflicting types for parameter 'T' ('float5' (vector of 5 'float' values) vs. 'float')}}
64 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, half>'}}
65 // expected-note@hlsl/hlsl_intrinsics.h:* {{candidate template ignored: substitution failure [with L = 5]: no type named 'Type' in 'hlsl::__detail::enable_if<false, float>'}}
66 }