[clang] [llvm] [HLSL] Implement ddx/ddy_coarse intrinsics (PR #164831)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 23 08:47:37 PDT 2025
================
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -verify
+
+float no_arg() {
+ return __builtin_hlsl_elementwise_ddy_coarse();
+ // expected-error at -1 {{too few arguments to function call, expected 1, have 0}}
+}
+
+float too_many_args(float val) {
+ return __builtin_hlsl_elementwise_ddy_coarse(val, val);
+ // expected-error at -1 {{too many arguments to function call, expected 1, have 2}}
+}
+
+float test_integer_scalar_input(int val) {
+ return __builtin_hlsl_elementwise_ddy_coarse(val);
+ // expected-error at -1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}}
+}
+
+double test_double_scalar_input(double val) {
+ return __builtin_hlsl_elementwise_ddy_coarse(val);
+ // expected-error at -1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'double')}}
+}
----------------
farzonl wrote:
add a new line
https://github.com/llvm/llvm-project/pull/164831
More information about the llvm-commits
mailing list