[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
Fri Jul 11 11:53:35 PDT 2025
================
@@ -100,11 +100,9 @@ int main() {
// Verify that SYCL kernel caller functions are emitted for each device target.
//
-// FIXME: The following set of matches are used to skip over the declaration of
-// main(). main() shouldn't be emitted in device code, but that pruning isn't
-// performed yet.
-// CHECK-DEVICE: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone
-// CHECK-DEVICE-NEXT: define {{[a-z_ ]*}}noundef i32 @main() #0
+// main() shouldn't be emitted in device code. It is not annotated with
+// sycl_kernel_entry_point or sycl_external attributes.
----------------
tahonermann wrote:
Since `main()` can't be declared with those attributes, I think we can simplify the comment.
```suggestion
// main() shouldn't be emitted in device code.
```
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list