================
@@ -0,0 +1,77 @@
+// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown 
-disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
+
+// This test code generation when sycl_external attribute is used
+
+// Function defined and not used - symbols emitted
+[[clang::sycl_external]] int square(int x) { return x*x; }
+// CHECK: define dso_local spir_func noundef i32 @_Z6squarei
+
+// Function defined and used - symbols emitted
+[[clang::sycl_external]] int squareUsed(int x) { return x*x; }
+// CHECK: define dso_local spir_func noundef i32 @_Z10squareUsedi
+
+// Constexpr function defined and not used - symbols emitted
----------------
schittir wrote:

I was under the opposite impression per one of the older review comments but I 
can't find it at the moment. No related wording in the spec either.

https://github.com/llvm/llvm-project/pull/140282
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to