Debian Codegraph @

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

raw
1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -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(float2 p0) {
4 return fmod(p0);
5 // expected-error@-1 {{no matching function for call to 'fmod'}}
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
12 float test_too_many_arg(float2 p0) {
13 return fmod(p0, p0, p0);
14 // expected-error@-1 {{no matching function for call to 'fmod'}}
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
21 float test_double_inputs(double p0, double p1) {
22 return fmod(p0, p1);
23 // expected-error@-1 {{no matching function for call to 'fmod'}}
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
30 float test_int_inputs(int p0, int p1) {
31 return fmod(p0, p1);
32 // expected-error@-1 {{no matching function for call to 'fmod'}}
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 float1 test_vec1_inputs(float1 p0, float1 p1) {
40 return fmod(p0, p1);
41 // expected-error@-1 {{no matching function for call to 'fmod'}}
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
48 typedef float float5 __attribute__((ext_vector_type(5)));
49
50 float5 test_vec5_inputs(float5 p0, float5 p1) {
51 return fmod(p0, p1);
52 // expected-error@-1 {{no matching function for call to 'fmod'}}
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 }