[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 19 12:07:44 PDT 2025


================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// expected-warning at +1{{'sycl_external' attribute ignored}}
+[[clang::sycl_external]] void bar() {}
+
+// expected-warning at +1{{'sycl_external' attribute ignored}}
+[[clang::sycl_external]] int a;
----------------
tahonermann wrote:

Ah, I missed that this test was exercising non-SYCL compilation. Nevermind, this looks exactly right!

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


More information about the cfe-commits mailing list