1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -verify
3 void test_no_second_arg(double D) {
4 __builtin_hlsl_elementwise_splitdouble(D);
5 // expected-error@-1 {{too few arguments to function call, expected 3, have 1}}
8 void test_no_third_arg(double D) {
10 __builtin_hlsl_elementwise_splitdouble(D, A);
11 // expected-error@-1 {{too few arguments to function call, expected 3, have 2}}
14 void test_too_many_arg(double D) {
16 __builtin_hlsl_elementwise_splitdouble(D, A, B, C);
17 // expected-error@-1 {{too many arguments to function call, expected 3, have 4}}
20 void test_first_arg_type_mismatch(bool3 D) {
22 __builtin_hlsl_elementwise_splitdouble(D, A, B);
23 // expected-error@-1 {{invalid operand of type 'bool3' (aka 'vector<bool, 3>') where 'double' or a vector of such type is required}}
26 void test_second_arg_type_mismatch(double D) {
29 __builtin_hlsl_elementwise_splitdouble(D, A, B);
30 // expected-error@-1 {{invalid operand of type 'bool' where 'unsigned int' or a vector of such type is required}}
33 void test_third_arg_type_mismatch(double D) {
36 __builtin_hlsl_elementwise_splitdouble(D, B, A);
37 // expected-error@-1 {{invalid operand of type 'bool' where 'unsigned int' or a vector of such type is required}}
40 void test_const_second_arg(double D) {
43 __builtin_hlsl_elementwise_splitdouble(D, A, B);
44 // expected-error@-1 {{cannot bind non-lvalue argument A to out paramemter}}
47 void test_const_third_arg(double D) {
50 __builtin_hlsl_elementwise_splitdouble(D, A, B);
51 // expected-error@-1 {{cannot bind non-lvalue argument B to out paramemter}}
54 void test_number_second_arg(double D) {
56 __builtin_hlsl_elementwise_splitdouble(D, (uint)1, B);
57 // expected-error@-1 {{cannot bind non-lvalue argument (uint)1 to out paramemter}}
60 void test_number_third_arg(double D) {
62 __builtin_hlsl_elementwise_splitdouble(D, B, (uint)1);
63 // expected-error@-1 {{cannot bind non-lvalue argument (uint)1 to out paramemter}}
66 void test_expr_second_arg(double D) {
68 __builtin_hlsl_elementwise_splitdouble(D, B+1, B);
69 // expected-error@-1 {{cannot bind non-lvalue argument B + 1 to out paramemter}}
72 void test_expr_third_arg(double D) {
74 __builtin_hlsl_elementwise_splitdouble(D, B, B+1);
75 // expected-error@-1 {{cannot bind non-lvalue argument B + 1 to out paramemter}}