Skip to content

Commit 08b1747

Browse files
authored
[SYCL] Add -only-needed for msan-pvc/cpu devicelib (#16980)
Signed-off-by: jinge90 <[email protected]>
1 parent 0bdedb5 commit 08b1747

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,8 @@ static llvm::SmallVector<StringRef, 16> SYCLDeviceLibList{
896896
"asan-cpu",
897897
"asan-dg2",
898898
"msan",
899+
"msan-pvc",
900+
"msan-cpu",
899901
#endif
900902
"imf",
901903
"imf-fp64",

clang/test/Driver/sycl-device-lib-old-model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@
368368
// RUN: --sysroot=%S/Inputs/SYCL -Xarch_device -fsanitize=memory -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN_PVC
369369
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xs "-device 12.60.7" --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL \
370370
// RUN: -Xarch_device -fsanitize=memory -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN_PVC
371-
// SYCL_DEVICE_LIB_MSAN_PVC: llvm-link{{.*}} "{{.*}}libsycl-crt.bc"
371+
// SYCL_DEVICE_LIB_MSAN_PVC: llvm-link{{.*}} "-only-needed" "{{.*}}libsycl-crt.bc"
372372
// SYCL_DEVICE_LIB_MSAN_PVC-SAME: "{{.*}}libsycl-msan-pvc.bc"
373373

374374

375375
/// ###########################################################################
376376
/// test behavior of linking libsycl-msan-cpu for CPU target AOT compilation when msan flag is applied.
377377
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL \
378378
// RUN: -Xarch_device -fsanitize=memory -### 2>&1 | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN_CPU
379-
// SYCL_DEVICE_LIB_MSAN_CPU: llvm-link{{.*}} "{{.*}}libsycl-crt.bc"
379+
// SYCL_DEVICE_LIB_MSAN_CPU: llvm-link{{.*}} "-only-needed" "{{.*}}libsycl-crt.bc"
380380
// SYCL_DEVICE_LIB_MSAN_CPU-SAME: "{{.*}}libsycl-msan-cpu.bc"

0 commit comments

Comments
 (0)