[clang] [clang][SYCL Upstreaming] Add sycl_external attribute and restrict emitting device code (PR #140282)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 14:07:57 PDT 2025
================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -verify %s
+
+// expected-warning at +1{{'sycl_external' attribute only applies to functions}}
+[[clang::sycl_external]] int a;
+
+
+// expected-warning at +2{{'sycl_external' attribute only applies to functions}}
+struct s {
+[[clang::sycl_external]] int b;
+};
+
+// FIXME: The first declaration of a function is required to have the attribute.
----------------
schittir wrote:
SYCL spec 2020 section 5.10.0 describes it so: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:syclexternal
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list