https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/214550
>From b44354158261fb156286f414079d3092a238225c Mon Sep 17 00:00:00 2001 From: kmpeng <[email protected]> Date: Thu, 6 Aug 2026 12:09:40 -0700 Subject: [PATCH] update atan2 matrix error test and rename test files --- ...oads_mat.hlsl => atan2_mat-overloads.hlsl} | 0 .../SemaHLSL/BuiltIns/atan2-errors_mat.hlsl | 7 ---- .../SemaHLSL/BuiltIns/atan2_mat-errors.hlsl | 36 +++++++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) rename clang/test/CodeGenHLSL/builtins/{atan2-overloads_mat.hlsl => atan2_mat-overloads.hlsl} (100%) delete mode 100644 clang/test/SemaHLSL/BuiltIns/atan2-errors_mat.hlsl create mode 100644 clang/test/SemaHLSL/BuiltIns/atan2_mat-errors.hlsl diff --git a/clang/test/CodeGenHLSL/builtins/atan2-overloads_mat.hlsl b/clang/test/CodeGenHLSL/builtins/atan2_mat-overloads.hlsl similarity index 100% rename from clang/test/CodeGenHLSL/builtins/atan2-overloads_mat.hlsl rename to clang/test/CodeGenHLSL/builtins/atan2_mat-overloads.hlsl diff --git a/clang/test/SemaHLSL/BuiltIns/atan2-errors_mat.hlsl b/clang/test/SemaHLSL/BuiltIns/atan2-errors_mat.hlsl deleted file mode 100644 index 19467d99d2292..0000000000000 --- a/clang/test/SemaHLSL/BuiltIns/atan2-errors_mat.hlsl +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -fnative-int16-type -emit-llvm-only -disable-llvm-passes -verify - - -double2x2 test_vec_double_builtin(double2x2 p0, double2x2 p1) { - return __builtin_elementwise_atan2(p0, p1); - // expected-error@-1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double2x2' (aka 'matrix<double, 2, 2>'))}} -} diff --git a/clang/test/SemaHLSL/BuiltIns/atan2_mat-errors.hlsl b/clang/test/SemaHLSL/BuiltIns/atan2_mat-errors.hlsl new file mode 100644 index 0000000000000..78690f74388ad --- /dev/null +++ b/clang/test/SemaHLSL/BuiltIns/atan2_mat-errors.hlsl @@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -fnative-int16-type -emit-llvm-only -disable-llvm-passes -verify + +float2x2 test_too_few_arg(float2x2 p0) { + return __builtin_elementwise_atan2(p0); + // expected-error@-1 {{too few arguments to function call, expected 2, have 1}} +} + +float2x2 test_too_many_arg(float2x2 p0) { + return __builtin_elementwise_atan2(p0, p0, p0); + // expected-error@-1 {{too many arguments to function call, expected 2, have 3}} +} + +int2x2 test_int_mat(int2x2 p0) { + return __builtin_elementwise_atan2(p0, p0); + // expected-error@-1 {{1st argument must be a scalar or vector of floating-point types (was 'int2x2' (aka 'matrix<int, 2, 2>'))}} +} + +float2x2 test_mismatched_dims(float2x2 p0, float3x3 p1) { + return __builtin_elementwise_atan2(p0, p1); + // expected-error@-1 {{arguments are of different types ('matrix<[...], 2, 2>' vs 'matrix<[...], 3, 3>')}} +} + +float2x2 test_mismatched_element_types(float2x2 p0, half2x2 p1) { + return __builtin_elementwise_atan2(p0, p1); + // expected-error@-1 {{arguments are of different types ('matrix<float, [2 * ...]>' vs 'matrix<half, [2 * ...]>')}} +} + +float2x2 test_scalar_and_matrix(float p0, float2x2 p1) { + return __builtin_elementwise_atan2(p0, p1); + // expected-error@-1 {{arguments are of different types ('float' vs 'float2x2' (aka 'matrix<float, 2, 2>'))}} +} + +float2x2 test_vector_and_matrix(float2 p0, float2x2 p1) { + return __builtin_elementwise_atan2(p0, p1); + // expected-error@-1 {{arguments are of different types ('float2' (aka 'vector<float, 2>') vs 'float2x2' (aka 'matrix<float, 2, 2>'))}} +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
