================
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown \
+// RUN: -disable-llvm-passes -emit-llvm -verify %s -o - | FileCheck %s
+
+// This test checks that the sycl_external attribute is ignored for variadic
+// functions; no device code is emitted for such functions.
+
+// expected-warning@+1{{'clang::sycl_external' attribute ignored; a variadic
function cannot be called from device code}}
+[[clang::sycl_external]] int variadic(int n, ...) { return n; }
+// CHECK-NOT: @_Z8variadiciz
----------------
tahonermann wrote:
Given the general fragility of `CHECK-NOT` checks, how about giving these
functions clearly identifiable names such that we can check for just the
identifier used to name the function rather than the mangled name? That will
prevent the test from spuriously passing if I eventually get my way and we
adopt Microsoft mangling when the auxiliary host is Windows.
```suggestion
// expected-warning@+1{{'clang::sycl_external' attribute ignored; a variadic
function cannot be called from device code}}
[[clang::sycl_external]] int variadic_fn_test1(int n, ...) { return n; }
// CHECK-NOT: variadic_fn_test1
```
https://github.com/llvm/llvm-project/pull/216393
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits