Skip to content

[HLSL] Update Sema Checking Diagnostics for builtins #138429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -12649,7 +12649,7 @@ def err_builtin_invalid_arg_type: Error<
// An 'or' if non-empty second and third components are combined
"%plural{0:|:%plural{0:|:or }2}3"
// Third component: floating-point types
"%select{|floating-point}3"
"%select{|floating-point|16 or 32 bit floating-point}3"
// A space after a non-empty third component
"%plural{0:|: }3"
"%plural{[0,3]:type|:types}1 (was %4)">;
Expand Down
317 changes: 130 additions & 187 deletions clang/lib/Sema/SemaHLSL.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions clang/test/SemaHLSL/BuiltIns/AddUint64-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ uint2 test_bad_num_arg_elements(uint3 a, uint3 b) {

uint2 test_scalar_arg_type(uint a) {
return __builtin_hlsl_adduint64(a, a);
// expected-error@-1 {{all arguments to '__builtin_hlsl_adduint64' must be vectors}}
// expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'uint' (aka 'unsigned int'))}}
}

uint2 test_uint64_args(uint16_t2 a) {
Expand All @@ -32,7 +32,7 @@ uint2 test_uint64_args(uint16_t2 a) {

uint2 test_signed_integer_args(int2 a, int2 b) {
return __builtin_hlsl_adduint64(a, b);
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(unsigned int)))) unsigned int' (vector of 2 'unsigned int' values)}}
// expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'int2' (aka 'vector<int, 2>'))}}
}

struct S {
Expand All @@ -41,6 +41,6 @@ struct S {

uint2 test_incorrect_arg_type(S a) {
return __builtin_hlsl_adduint64(a, a);
// expected-error@-1 {{passing 'S' to parameter of incompatible type 'unsigned int'}}
// expected-error@-1 {{1st argument must be a vector of unsigned integer types (was 'S')}}
}

10 changes: 10 additions & 0 deletions clang/test/SemaHLSL/BuiltIns/asdouble-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ double test_too_many_arg(uint p0) {
return __builtin_hlsl_asdouble(p0, p0, p0);
// expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
}

double test_non_matching(uint p0, uint2 p1) {
return __builtin_hlsl_asdouble(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_asdouble' must have the same type}}
}

double test_non_uint(uint64_t p0) {
return __builtin_hlsl_asdouble(p0, p0);
// expected-error@-1 {{invalid operand of type 'uint64_t' (aka 'unsigned long') where 'unsigned int' or a vector of such type is required}}
}
27 changes: 16 additions & 11 deletions clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ float2 test_scalar_first_arg3(float p0, float2 p1) {

float3 test_clamp_vector_size_last_arg_mismatch(float3 p0, float2 p1) {
return clamp(p0, p0, p1);
// expected-error@-1 {{all arguments to 'clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<[...], 3>' vs 'vector<[...], 2>')}}
}

typedef float float5 __attribute__((ext_vector_type(5)));
Expand All @@ -55,7 +55,7 @@ float2 test_clamp_vector_size_ret_mismatch(float3 p0, float3 p1) {

float2 test_clamp_builtin_vector_size_first_arg_mismatch(float3 p0, float2 p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<[...], 3>' vs 'vector<[...], 2>')}}
}

float test_clamp_scalar_mismatch(float p0, half p1) {
Expand All @@ -70,32 +70,32 @@ float2 test_clamp_element_type_mismatch(half2 p0, float2 p1) {

float2 test_builtin_clamp_float2_splat(float p0, float2 p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float2' (aka 'vector<float, 2>'))}}
}

float3 test_builtin_clamp_float3_splat(float p0, float3 p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float3' (aka 'vector<float, 3>'))}}
}

float4 test_builtin_clamp_float4_splat(float p0, float4 p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float4' (aka 'vector<float, 4>'))}}
}

float2 test_clamp_float2_int_splat(float2 p0, int p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float2' (aka 'vector<float, 2>') vs 'int')}}
}

float3 test_clamp_float3_int_splat(float3 p0, int p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float3' (aka 'vector<float, 3>') vs 'int')}}
}

float2 test_builtin_clamp_int_vect_to_float_vec_promotion(int2 p0, float p1) {
return __builtin_hlsl_elementwise_clamp(p0, p1, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('int2' (aka 'vector<int, 2>') vs 'float')}}
}

float test_builtin_clamp_bool_type_promotion(bool p0) {
Expand All @@ -105,15 +105,20 @@ float test_builtin_clamp_bool_type_promotion(bool p0) {

float builtin_bool_to_float_type_promotion(float p0, bool p1) {
return __builtin_hlsl_elementwise_clamp(p0, p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{3rd argument must be a vector, integer or floating-point type (was 'bool')}}
}

float builtin_bool_to_float_type_promotion2(bool p0, float p1) {
return __builtin_hlsl_elementwise_clamp(p1, p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{2nd argument must be a vector, integer or floating-point type (was 'bool')}}
}

float builtin_clamp_int_to_float_promotion(float p0, int p1) {
return __builtin_hlsl_elementwise_clamp(p0, p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_elementwise_clamp' must have the same type}}
// expected-error@-1 {{arguments are of different types ('float' vs 'int')}}
}

float builtin_clamp_reject_array(int Arr[2]) {
return __builtin_hlsl_elementwise_clamp(Arr, Arr, Arr);
// expected-error@-1 {{1st argument must be a vector, integer or floating-point type (was 'int *')}}
}
12 changes: 9 additions & 3 deletions clang/test/SemaHLSL/BuiltIns/cross-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ void test_too_many_arg(float3 p0)
bool builtin_bool_to_float_type_promotion(bool p1)
{
return __builtin_hlsl_cross(p1, p1);
// expected-error@-1 {{passing 'bool' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a vector of 16 or 32 bit floating-point types (was 'bool')}}
}

bool builtin_cross_int_to_float_promotion(int p1)
{
return __builtin_hlsl_cross(p1, p1);
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a vector of 16 or 32 bit floating-point types (was 'int')}}
}

bool2 builtin_cross_int2_to_float2_promotion(int2 p1)
{
return __builtin_hlsl_cross(p1, p1);
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a vector of 16 or 32 bit floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
}

float2 builtin_cross_float2(float2 p1, float2 p2)
Expand All @@ -39,5 +39,11 @@ float2 builtin_cross_float2(float2 p1, float2 p2)
float3 builtin_cross_float3_int3(float3 p1, int3 p2)
{
return __builtin_hlsl_cross(p1, p2);
// expected-error@-1 {{2nd argument must be a vector of 16 or 32 bit floating-point types (was 'int3' (aka 'vector<int, 3>'))}}
}

half3 builtin_cross_same_type(half3 p0, float3 p1)
{
return __builtin_hlsl_cross(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_cross' must have the same type}}
}
6 changes: 3 additions & 3 deletions clang/test/SemaHLSL/BuiltIns/degrees-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ float2 test_too_many_arg(float2 p0) {

float builtin_bool_to_float_type_promotion(bool p1) {
return __builtin_hlsl_elementwise_degrees(p1);
// expected-error@-1 {{passing 'bool' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'bool')}}
}

float builtin_degrees_int_to_float_promotion(int p1) {
return __builtin_hlsl_elementwise_degrees(p1);
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}}
}

float2 builtin_degrees_int2_to_float2_promotion(int2 p1) {
return __builtin_hlsl_elementwise_degrees(p1);
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
}
33 changes: 17 additions & 16 deletions clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ float test_dot_no_second_arg(float2 p0) {

float test_dot_vector_size_mismatch(float3 p0, float2 p1) {
return dot(p0, p1);
// expected-error@-1 {{all arguments to 'dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<[...], 3>' vs 'vector<[...], 2>')}}
}

float test_dot_builtin_vector_size_mismatch(float3 p0, float2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<[...], 3>' vs 'vector<[...], 2>')}}
}

float test_dot_scalar_mismatch(float p0, int p1) {
Expand All @@ -38,70 +38,70 @@ float test_dot_element_type_mismatch(int2 p0, float2 p1) {
//NOTE: for all the *_promotion we are intentionally not handling type promotion in builtins
float test_builtin_dot_vec_int_to_float_promotion(int2 p0, float2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<int, [...]>' vs 'vector<float, [...]>')}}
}

int64_t test_builtin_dot_vec_int_to_int64_promotion(int64_t2 p0, int2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<int64_t, [...]>' vs 'vector<int, [...]>')}}
}

float test_builtin_dot_vec_half_to_float_promotion(float2 p0, half2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<float, [...]>' vs 'vector<half, [...]>')}}
}

#ifdef __HLSL_ENABLE_16_BIT
float test_builtin_dot_vec_int16_to_float_promotion(float2 p0, int16_t2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<float, [...]>' vs 'vector<int16_t, [...]>')}}
}

half test_builtin_dot_vec_int16_to_half_promotion(half2 p0, int16_t2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<half, [...]>' vs 'vector<int16_t, [...]>')}}
}

int test_builtin_dot_vec_int16_to_int_promotion(int2 p0, int16_t2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<int, [...]>' vs 'vector<int16_t, [...]>')}}
}

int64_t test_builtin_dot_vec_int16_to_int64_promotion(int64_t2 p0,
int16_t2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must have the same type}}
// expected-error@-1 {{arguments are of different types ('vector<int64_t, [...]>' vs 'vector<int16_t, [...]>')}}
}
#endif

float test_builtin_dot_float2_splat(float p0, float2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float2' (aka 'vector<float, 2>'))}}
}

float test_builtin_dot_float3_splat(float p0, float3 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float3' (aka 'vector<float, 3>'))}}
}

float test_builtin_dot_float4_splat(float p0, float4 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('float' vs 'float4' (aka 'vector<float, 4>'))}}
}

float test_dot_float2_int_splat(float2 p0, int p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('float2' (aka 'vector<float, 2>') vs 'int')}}
}

float test_dot_float3_int_splat(float3 p0, int p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('float3' (aka 'vector<float, 3>') vs 'int')}}
}

float test_builtin_dot_int_vect_to_float_vec_promotion(int2 p0, float p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{all arguments to '__builtin_hlsl_dot' must be vectors}}
// expected-error@-1 {{arguments are of different types ('int2' (aka 'vector<int, 2>') vs 'float')}}
}

int test_builtin_dot_bool_type_promotion(bool p0, float p1) {
Expand All @@ -113,9 +113,10 @@ double test_dot_double(double2 p0, double2 p1) {
return dot(p0, p1);
// expected-error@-1 {{call to 'dot' is ambiguous}}
}

double test_dot_double_builtin(double2 p0, double2 p1) {
return __builtin_hlsl_dot(p0, p1);
// expected-error@-1 {{passing 'double2' (aka 'vector<double, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar floating-point type (was 'double2' (aka 'vector<double, 2>'))}}
}

float builtin_bool_to_float_type_promotion ( float p0, bool p1 ) {
Expand Down
8 changes: 4 additions & 4 deletions clang/test/SemaHLSL/BuiltIns/frac-errors.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify

float test_too_few_arg() {
return __builtin_hlsl_elementwise_frac();
Expand All @@ -13,16 +13,16 @@ float2 test_too_many_arg(float2 p0) {

float builtin_bool_to_float_type_promotion(bool p1) {
return __builtin_hlsl_elementwise_frac(p1);
// expected-error@-1 {{passing 'bool' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'bool')}}
}

float builtin_frac_int_to_float_promotion(int p1) {
return __builtin_hlsl_elementwise_frac(p1);
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}}
}

float2 builtin_frac_int2_to_float2_promotion(int2 p1) {
return __builtin_hlsl_elementwise_frac(p1);
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
}

4 changes: 2 additions & 2 deletions clang/test/SemaHLSL/BuiltIns/half-float-only-errors.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

double test_double_builtin(double p0) {
return TEST_FUNC(p0);
// expected-error@-1 {{passing 'double' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}}
}

double2 test_vec_double_builtin(double2 p0) {
return TEST_FUNC(p0);
// expected-error@-1 {{passing 'double2' (aka 'vector<double, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double2' (aka 'vector<double, 2>'))}}
}
4 changes: 2 additions & 2 deletions clang/test/SemaHLSL/BuiltIns/half-float-only-errors2.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

double test_double_builtin(double p0, double p1) {
return TEST_FUNC(p0, p1);
// expected-error@-1 {{passing 'double' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}}
}

double2 test_vec_double_builtin(double2 p0, double2 p1) {
return TEST_FUNC(p0, p1);
// expected-error@-1 {{passing 'double2' (aka 'vector<double, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double2' (aka 'vector<double, 2>'))}}
}
12 changes: 6 additions & 6 deletions clang/test/SemaHLSL/BuiltIns/isinf-errors.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify

bool test_too_few_arg() {
return __builtin_hlsl_elementwise_isinf();
Expand All @@ -13,26 +13,26 @@ bool2 test_too_many_arg(float2 p0) {

bool builtin_bool_to_float_type_promotion(bool p1) {
return __builtin_hlsl_elementwise_isinf(p1);
// expected-error@-1 {passing 'bool' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'bool')}}
}

bool builtin_isinf_int_to_float_promotion(int p1) {
return __builtin_hlsl_elementwise_isinf(p1);
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}}
}

bool2 builtin_isinf_int2_to_float2_promotion(int2 p1) {
return __builtin_hlsl_elementwise_isinf(p1);
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int2' (aka 'vector<int, 2>'))}}
}

// builtins are variadic functions and so are subject to DefaultVariadicArgumentPromotion
half builtin_isinf_half_scalar (half p0) {
return __builtin_hlsl_elementwise_isinf (p0);
// expected-error@-1 {{passing 'double' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}}
}

float builtin_isinf_float_scalar ( float p0) {
return __builtin_hlsl_elementwise_isinf (p0);
// expected-error@-1 {{passing 'double' to parameter of incompatible type 'float'}}
// expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}}
}
Loading