|
1 | | -// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify |
| 1 | +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify |
2 | 2 |
|
3 | | -bool test_too_few_arg() { |
| 3 | +float test_too_few_arg() { |
4 | 4 | return __builtin_hlsl_dot2add(); |
5 | 5 | // expected-error@-1 {{too few arguments to function call, expected 3, have 0}} |
6 | 6 | } |
7 | 7 |
|
8 | | -bool test_too_many_arg(half2 p1, half2 p2, float p3) { |
| 8 | +float test_too_many_arg(half2 p1, half2 p2, float p3) { |
9 | 9 | return __builtin_hlsl_dot2add(p1, p2, p3, p1); |
10 | 10 | // expected-error@-1 {{too many arguments to function call, expected 3, have 4}} |
11 | 11 | } |
| 12 | + |
| 13 | +float test_float_arg2_type(half2 p1, float2 p2, float p3) { |
| 14 | + return __builtin_hlsl_dot2add(p1, p2, p3); |
| 15 | + // expected-error@-1 {{passing 'float2' (aka 'vector<float, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(half)))) half' (vector of 2 'half' values)}} |
| 16 | +} |
| 17 | + |
| 18 | +float test_float_arg1_type(float2 p1, half2 p2, float p3) { |
| 19 | + return __builtin_hlsl_dot2add(p1, p2, p3); |
| 20 | + // expected-error@-1 {{passing 'float2' (aka 'vector<float, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(half)))) half' (vector of 2 'half' values)}} |
| 21 | +} |
| 22 | + |
| 23 | +float test_double_arg3_type(half2 p1, half2 p2, double p3) { |
| 24 | + return __builtin_hlsl_dot2add(p1, p2, p3); |
| 25 | + // expected-error@-1 {{passing 'double' to parameter of incompatible type 'float'}} |
| 26 | +} |
| 27 | + |
| 28 | +float test_float_arg1_arg2_type(float2 p1, float2 p2, float p3) { |
| 29 | + return __builtin_hlsl_dot2add(p1, p2, p3); |
| 30 | + // expected-error@-1 {{passing 'float2' (aka 'vector<float, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(half)))) half' (vector of 2 'half' values)}} |
| 31 | +} |
| 32 | + |
| 33 | +float test_int16_arg1_arg2_type(int16_t2 p1, int16_t2 p2, float p3) { |
| 34 | + return __builtin_hlsl_dot2add(p1, p2, p3); |
| 35 | + // expected-error@-1 {{passing 'int16_t2' (aka 'vector<int16_t, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(half)))) half' (vector of 2 'half' values)}} |
| 36 | +} |
0 commit comments