[clang] [SYCL][Driver] Pass -lsycl by default for SYCL compilation. (PR #174877)
Michael Toguchi via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 12 13:18:10 PST 2026
================
@@ -29,6 +29,13 @@
// CHK-DEVICE-TRIPLE-SAME: "-O2"
// CHK-DEVICE-TRIPLE: llvm-offload-binary{{.*}} "--image=file={{.*}}.bc,triple=spirv64-unknown-unknown,arch=generic,kind=sycl"
+// Check if -lsycl is passed to clang-linker-wrapper tool by default for SYCL compilation.
+// RUN: %clang -### -fsycl %s 2>&1 \
+// RUN: | FileCheck -check-prefixes=CHECK-LSYCL,CHECK-SYCL-HEADERS-HOST,CHECK-SYCL-HEADERS-DEVICE %s
+// CHECK-SYCL-HEADERS-DEVICE: "-fsycl-is-device"{{.*}} "-internal-isystem" "{{.*}}build/bin/../include"
+// CHECK-SYCL-HEADERS-HOST: "-fsycl-is-host"{{.*}} "-internal-isystem" "{{.*}}build/bin/../include"
+// CHECK-LSYCL: clang-linker-wrapper{{.*}} "-L{{.*}}build/bin/../lib"{{.*}} "-lsycl"
----------------
mdtoguchi wrote:
Is the `build/bin` directory guaranteed, or is the `build` directory just a build setting that can be changed? Maybe just `bin/../include` and `bin/../lib` would be better here.
https://github.com/llvm/llvm-project/pull/174877
More information about the cfe-commits
mailing list