-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a32543
commit a676944
Showing
4 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -verify | ||
|
||
void test_no_second_arg(double D) { | ||
__builtin_hlsl_elementwise_splitdouble(D); | ||
// expected-error@-1 {{too few arguments to function call, expected 3, have 1}} | ||
} | ||
|
||
void test_no_third_arg(double D) { | ||
uint A; | ||
__builtin_hlsl_elementwise_splitdouble(D, A); | ||
// expected-error@-1 {{too few arguments to function call, expected 3, have 2}} | ||
} | ||
|
||
void test_too_many_arg(double D) { | ||
uint A, B, C; | ||
__builtin_hlsl_elementwise_splitdouble(D, A, B, C); | ||
// expected-error@-1 {{too many arguments to function call, expected 3, have 4}} | ||
} | ||
|
||
void test_first_arg_type_mismatch(bool3 D) { | ||
uint3 A, B; | ||
__builtin_hlsl_elementwise_splitdouble(D, A, B); | ||
// expected-error@-1 {{invalid operand of type 'bool3' (aka 'vector<bool, 3>') where 'double' or a vector of such type is required}} | ||
} | ||
|
||
void test_second_arg_type_mismatch(double D) { | ||
bool A; | ||
uint B; | ||
__builtin_hlsl_elementwise_splitdouble(D, A, B); | ||
// expected-error@-1 {{invalid operand of type 'bool' where 'unsigned int' or a vector of such type is required}} | ||
} | ||
|
||
void test_third_arg_type_mismatch(double D) { | ||
bool A; | ||
uint B; | ||
__builtin_hlsl_elementwise_splitdouble(D, B, A); | ||
// expected-error@-1 {{invalid operand of type 'bool' where 'unsigned int' or a vector of such type is required}} | ||
} | ||
|
||
void test_const_second_arg(double D) { | ||
const uint A = 1; | ||
uint B; | ||
__builtin_hlsl_elementwise_splitdouble(D, A, B); | ||
// expected-error@-1 {{cannot bind non-lvalue argument}} | ||
} | ||
|
||
void test_const_third_arg(double D) { | ||
uint A; | ||
const uint B = 2; | ||
__builtin_hlsl_elementwise_splitdouble(D, A, B); | ||
// expected-error@-1 {{cannot bind non-lvalue argument}} | ||
} |