Skip to content

Commit 221f9c8

Browse files
authored
[SYCL] Link sycl-devicelib-host lib in clang-cl + fscyl by default. (#6503)
1 parent a37af44 commit 221f9c8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8140,6 +8140,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
81408140
CmdArgs.push_back("--dependent-lib=sycld");
81418141
else
81428142
CmdArgs.push_back("--dependent-lib=sycl");
8143+
CmdArgs.push_back("--dependent-lib=sycl-devicelib-host");
81438144
}
81448145
}
81458146

clang/test/Driver/sycl-device-lib-win.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,9 @@
165165
// SYCL_LLVM_LINK_NO_DEVICE_LIB: clang{{.*}} "-cc1" {{.*}} "-fsycl-is-device"
166166
// SYCL_LLVM_LINK_NO_DEVICE_LIB-NOT: llvm-link{{.*}} "-only-needed"
167167
// SYCL_LLVM_LINK_NO_DEVICE_LIB: sycl-post-link{{.*}} "-symbols" "-spec-const=rt" {{.*}} "-o" "{{.*}}.table" "{{.*}}.bc"
168+
169+
/// ###########################################################################
170+
/// test clang-cl behavior for linking sycl-devicelib-host.lib by default
171+
// RUN: %clang_cl -fsycl %s /winsysroot=%S/Inputs/SYCL-windows -### 2>&1 \
172+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_HOST_LIB
173+
// SYCL_DEVICE_HOST_LIB: {{.*}} "--dependent-lib=sycl-devicelib-host" {{.*}}

0 commit comments

Comments
 (0)