@@ -20,16 +20,38 @@ float2 test_lerp_no_second_arg(float2 p0) {
20
20
// expected-error@-1 {{no matching function for call to 'lerp'}}
21
21
}
22
22
23
- float2 test_lerp_vector_size_mismatch (float3 p0, float2 p1) {
23
+ float2 test_lerp_vector_trunc_warn1 (float3 p0) {
24
+ return lerp (p0, p0, p0);
25
+ // expected-warning@-1 {{implicit conversion truncates vector: 'float3' (aka 'vector<float, 3>') to 'vector<float, 2>' (vector of 2 'float' values)}}
26
+ }
27
+
28
+ float2 test_lerp_vector_trunc_warn2 (float3 p0, float2 p1) {
24
29
return lerp (p0, p0, p1);
25
30
// expected-warning@-1 {{implicit conversion truncates vector: 'float3' (aka 'vector<float, 3>') to 'vector<float, 2>' (vector of 2 'float' values)}}
31
+ // expected-warning@-2 {{implicit conversion truncates vector: 'float3' (aka 'vector<float, 3>') to 'vector<float, 2>' (vector of 2 'float' values)}}
32
+ }
33
+
34
+ float2 test_lerp_vector_trunc_warn3 (float3 p0, float2 p1) {
35
+ return lerp (p0, p1, p0);
36
+ // expected-warning@-1 {{implicit conversion truncates vector: 'float3' (aka 'vector<float, 3>') to 'vector<float, 2>' (vector of 2 'float' values)}}
37
+ // expected-warning@-2 {{implicit conversion truncates vector: 'float3' (aka 'vector<float, 3>') to 'vector<float, 2>' (vector of 2 'float' values)}}
26
38
}
27
39
28
- float2 test_lerp_builtin_vector_size_mismatch (float3 p0, float2 p1) {
40
+ float2 test_lerp_builtin_vector_size_mismatch_Arg1 (float3 p0, float2 p1) {
29
41
return __builtin_hlsl_lerp (p0, p1, p1);
30
42
// expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must have the same type}}
31
43
}
32
44
45
+ float2 test_lerp_builtin_vector_size_mismatch_Arg2 (float3 p0, float2 p1) {
46
+ return __builtin_hlsl_lerp (p1, p0, p1);
47
+ // expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must have the same type}}
48
+ }
49
+
50
+ float2 test_lerp_builtin_vector_size_mismatch_Arg3 (float3 p0, float2 p1) {
51
+ return __builtin_hlsl_lerp (p1, p1, p0);
52
+ // expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must have the same type}}
53
+ }
54
+
33
55
float test_lerp_scalar_mismatch (float p0, half p1) {
34
56
return lerp (p1, p0, p1);
35
57
// expected-error@-1 {{call to 'lerp' is ambiguous}}
@@ -45,6 +67,16 @@ float2 test_builtin_lerp_float2_splat(float p0, float2 p1) {
45
67
// expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must be vectors}}
46
68
}
47
69
70
+ float2 test_builtin_lerp_float2_splat2 (double p0, double2 p1) {
71
+ return __builtin_hlsl_lerp (p1, p0, p1);
72
+ // expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must be vectors}}
73
+ }
74
+
75
+ float2 test_builtin_lerp_float2_splat3 (double p0, double2 p1) {
76
+ return __builtin_hlsl_lerp (p1, p1, p0);
77
+ // expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must be vectors}}
78
+ }
79
+
48
80
float3 test_builtin_lerp_float3_splat (float p0, float3 p1) {
49
81
return __builtin_hlsl_lerp (p0, p1, p1);
50
82
// expected-error@-1 {{all arguments to '__builtin_hlsl_lerp' must be vectors}}
0 commit comments