Debian Codegraph @

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

raw
1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-int16-type -emit-llvm-only -disable-llvm-passes -verify
2
3 float builtin_f16tof32_too_few_arg() {
4 return __builtin_hlsl_elementwise_f16tof32();
5 // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
6 // expected-note@hlsl/hlsl_alias_intrinsics.h:* 4 {{candidate function not viable: requires 1 argument, but 0 were provided}}
7 }
8
9 float builtin_f16tof32_too_many_arg(uint p0) {
10 return __builtin_hlsl_elementwise_f16tof32(p0, p0);
11 // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
12 // expected-note@hlsl/hlsl_alias_intrinsics.h:* 4 {{candidate function not viable: requires 1 argument, but 2 were provided}}
13 }
14
15 float builtin_f16tof32_bool(bool p0) {
16 return __builtin_hlsl_elementwise_f16tof32(p0);
17 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool')}}
18 }
19
20 float builtin_f16tof32_bool4(bool4 p0) {
21 return __builtin_hlsl_elementwise_f16tof32(p0);
22 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool4' (aka 'vector<bool, 4>')}}
23 }
24
25 float builtin_f16tof32_short(short p0) {
26 return __builtin_hlsl_elementwise_f16tof32(p0);
27 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'short')}}
28 }
29
30 float builtin_f16tof32_unsigned_short(unsigned short p0) {
31 return __builtin_hlsl_elementwise_f16tof32(p0);
32 // expected-error@-1 {{incorrect number of bits in integer (expected 32 bits, have 16)}}
33 }
34
35 float builtin_f16tof32_int(int p0) {
36 return __builtin_hlsl_elementwise_f16tof32(p0);
37 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int')}}
38 }
39
40 float builtin_f16tof32_int64_t(long p0) {
41 return __builtin_hlsl_elementwise_f16tof32(p0);
42 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'long')}}
43 }
44
45 float2 builtin_f16tof32_int2_to_float2_promotion(int2 p0) {
46 return __builtin_hlsl_elementwise_f16tof32(p0);
47 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int2' (aka 'vector<int, 2>'))}}
48 }
49
50 float builtin_f16tof32_half(half p0) {
51 return __builtin_hlsl_elementwise_f16tof32(p0);
52 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half')}}
53 }
54
55 float builtin_f16tof32_half4(half4 p0) {
56 return __builtin_hlsl_elementwise_f16tof32(p0);
57 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half4' (aka 'vector<half, 4>'))}}
58 }
59
60 float builtin_f16tof32_float(float p0) {
61 return __builtin_hlsl_elementwise_f16tof32(p0);
62 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'float')}}
63 }
64
65 float builtin_f16tof32_double(double p0) {
66 return __builtin_hlsl_elementwise_f16tof32(p0);
67 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'double')}}
68 }
69
70 float f16tof32_too_few_arg() {
71 return f16tof32();
72 // expected-error@-1 {{no matching function for call to 'f16tof32'}}
73 }
74
75 float f16tof32_too_many_arg(uint p0) {
76 return f16tof32(p0, p0);
77 // expected-error@-1 {{no matching function for call to 'f16tof32'}}
78 }
79
80 float f16tof32_bool(bool p0) {
81 return f16tof32(p0);
82 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool')}}
83 }
84
85 float f16tof32_bool3(bool3 p0) {
86 return f16tof32(p0);
87 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool3' (aka 'vector<bool, 3>'))}}
88 }
89
90
91 float f16tof32_int16_t(short p0) {
92 return f16tof32(p0);
93 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'short')}}
94 }
95
96 float f16tof32_int16_t(unsigned short p0) {
97 return f16tof32(p0);
98 // expected-error@-1 {{incorrect number of bits in integer (expected 32 bits, have 16)}}
99 }
100
101 float f16tof32_int(int p0) {
102 return f16tof32(p0);
103 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int')}}
104 }
105
106 float f16tof32_int64_t(long p0) {
107 return f16tof32(p0);
108 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'long')}}
109 }
110
111 float2 f16tof32_int2_to_float2_promotion(int3 p0) {
112 return f16tof32(p0);
113 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int3' (aka 'vector<int, 3>'))}}
114 }
115
116 float f16tof32_half(half p0) {
117 return f16tof32(p0);
118 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half')}}
119 }
120
121 float f16tof32_half2(half2 p0) {
122 return f16tof32(p0);
123 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half2' (aka 'vector<half, 2>'))}}
124 }
125
126 float f16tof32_float(float p0) {
127 return f16tof32(p0);
128 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'float')}}
129 }
130
131 float f16tof32_double(double p0) {
132 return f16tof32(p0);
133 // expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'double')}}
134 }