[clang] [llvm] [HLSL][DXIL] Implement `asdouble` intrinsic (PR #114847)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 09:12:37 PST 2024


================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
+
+double test_too_few_arg() {
+  return __builtin_hlsl_asdouble();
+  // expected-error at -1 {{too few arguments to function call, expected 2, have 0}}
+}
+
+double test_too_few_arg_1(uint p0) {
+  return __builtin_hlsl_asdouble(p0);
+  // expected-error at -1 {{too few arguments to function call, expected 2, have 1}}
+}
+
+double test_too_many_arg(uint p0) {
+  return __builtin_hlsl_asdouble(p0, p0, p0);
+  // expected-error at -1 {{too many arguments to function call, expected 2, have 3}}
+}
----------------
joaosaffran wrote:

I feel like adding some tests to check for type mismatch would be useful

https://github.com/llvm/llvm-project/pull/114847


More information about the cfe-commits mailing list