Skip to content

Commit a707baa

Browse files
committed
add driver tests
1 parent ac08ed7 commit a707baa

File tree

4 files changed

+142
-50
lines changed

4 files changed

+142
-50
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ static llvm::SmallVector<StringRef, 16> SYCLDeviceLibList{
822822
"asan-pvc",
823823
"asan-cpu",
824824
"asan-dg2",
825+
"msan",
825826
#endif
826827
"imf",
827828
"imf-fp64",

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

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -198,35 +198,35 @@
198198
/// ###########################################################################
199199
/// test behavior of libsycl-asan.bc linking when -fsanitize=address is available
200200
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -fsanitize=address -### 2>&1 \
201-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
201+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
202202
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend -fsanitize=address -### 2>&1 \
203-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
203+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
204204
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend=spir64 -fsanitize=address -### 2>&1 \
205-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
205+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
206206
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device -fsanitize=address -### 2>&1 \
207-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
207+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
208208
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=address -DUSE_SYCL_DEVICE_ASAN" -### 2>&1 \
209-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
209+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
210210
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=address -DUSE_SYCL_DEVICE_ASAN" -### 2>&1 \
211211
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_ASAN_MACRO
212-
// SYCL_DEVICE_LIB_SANITIZER: llvm-link{{.*}} "{{.*}}libsycl-crt.bc"
213-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-complex.bc"
214-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-complex-fp64.bc"
215-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-cmath.bc"
216-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-cmath-fp64.bc"
217-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-imf.bc"
218-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-imf-fp64.bc"
219-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-imf-bf16.bc"
220-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-cassert.bc"
221-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-cstring.bc"
222-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-complex.bc"
223-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc"
224-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-cmath.bc"
225-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc"
226-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-imf.bc"
227-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc"
228-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc"
229-
// SYCL_DEVICE_LIB_SANITIZER-SAME: "{{.*}}libsycl-asan.bc"
212+
// SYCL_DEVICE_LIB_ASAN: llvm-link{{.*}} "{{.*}}libsycl-crt.bc"
213+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-complex.bc"
214+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-complex-fp64.bc"
215+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-cmath.bc"
216+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-cmath-fp64.bc"
217+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-imf.bc"
218+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-imf-fp64.bc"
219+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-imf-bf16.bc"
220+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-cassert.bc"
221+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-cstring.bc"
222+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-complex.bc"
223+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc"
224+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-cmath.bc"
225+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc"
226+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-imf.bc"
227+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc"
228+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc"
229+
// SYCL_DEVICE_LIB_ASAN-SAME: "{{.*}}libsycl-asan.bc"
230230
// SYCL_DEVICE_ASAN_MACRO: "-cc1"
231231
// SYCL_DEVICE_ASAN_MACRO-SAME: "USE_SYCL_DEVICE_ASAN"
232232
// SYCL_DEVICE_ASAN_MACRO: llvm-link{{.*}} "-only-needed"
@@ -317,3 +317,41 @@
317317
// SYCL_DEVICE_LIB_ASAN_DG2-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc"
318318
// SYCL_DEVICE_LIB_ASAN_DG2-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc"
319319
// SYCL_DEVICE_LIB_ASAN_DG2-SAME: "{{.*}}libsycl-asan-dg2.bc"
320+
321+
322+
/// ###########################################################################
323+
/// test behavior of libsycl-msan.bc linking when -fsanitize=memory is available
324+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -fsanitize=memory -### 2>&1 \
325+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
326+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend -fsanitize=memory -### 2>&1 \
327+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
328+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend=spir64 -fsanitize=memory -### 2>&1 \
329+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
330+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device -fsanitize=memory -### 2>&1 \
331+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
332+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=memory -DUSE_SYCL_DEVICE_MSAN" -### 2>&1 \
333+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
334+
// RUN: %clangxx -fsycl --no-offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=memory -DUSE_SYCL_DEVICE_MSAN" -### 2>&1 \
335+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_MSAN_MACRO
336+
// SYCL_DEVICE_LIB_MSAN: llvm-link{{.*}} "{{.*}}libsycl-crt.bc"
337+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-complex.bc"
338+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-complex-fp64.bc"
339+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-cmath.bc"
340+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-cmath-fp64.bc"
341+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-imf.bc"
342+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-imf-fp64.bc"
343+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-imf-bf16.bc"
344+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-cassert.bc"
345+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-cstring.bc"
346+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-complex.bc"
347+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-complex-fp64.bc"
348+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-cmath.bc"
349+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-cmath-fp64.bc"
350+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-imf.bc"
351+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-imf-fp64.bc"
352+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-fallback-imf-bf16.bc"
353+
// SYCL_DEVICE_LIB_MSAN-SAME: "{{.*}}libsycl-msan.bc"
354+
// SYCL_DEVICE_MSAN_MACRO: "-cc1"
355+
// SYCL_DEVICE_MSAN_MACRO-SAME: "USE_SYCL_DEVICE_MSAN"
356+
// SYCL_DEVICE_MSAN_MACRO: llvm-link{{.*}} "-only-needed"
357+
// SYCL_DEVICE_MSAN_MACRO-SAME: "{{.*}}libsycl-msan.bc"

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

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -155,36 +155,36 @@
155155
/// ###########################################################################
156156
/// test behavior of libsycl-asan.o linking when -fsanitize=address is available
157157
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -fsanitize=address -### 2>&1 \
158-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
158+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
159159
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend -fsanitize=address -### 2>&1 \
160-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
160+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
161161
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend=spir64 -fsanitize=address -### 2>&1 \
162-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
162+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
163163
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device -fsanitize=address -### 2>&1 \
164-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
164+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
165165
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=address -DUSE_SYCL_DEVICE_ASAN" -### 2>&1 \
166-
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_SANITIZER
166+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_ASAN
167167
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=address -DUSE_SYCL_DEVICE_ASAN" -### 2>&1 \
168168
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_ASAN_MACRO
169-
// SYCL_DEVICE_LIB_SANITIZER: clang-linker-wrapper{{.*}} "-sycl-device-libraries
170-
// SYCL_DEVICE_LIB_SANITIZER: {{.*}}libsycl-crt.new.o
171-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-complex.
172-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-complex-fp64.
173-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-cmath.new.o
174-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-cmath-fp64.new.o
175-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-imf.new.o
176-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-imf-fp64.new.o
177-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-imf-bf16.new.o
178-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-cassert.new.o
179-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-cstring.new.o
180-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-complex.new.o
181-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-complex-fp64.new.o
182-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-cmath.new.o
183-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-cmath-fp64.new.o
184-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-imf.new.o
185-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o
186-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o
187-
// SYCL_DEVICE_LIB_SANITIZER-SAME: {{.*}}libsycl-asan.new.o
169+
// SYCL_DEVICE_LIB_ASAN: clang-linker-wrapper{{.*}} "-sycl-device-libraries
170+
// SYCL_DEVICE_LIB_ASAN: {{.*}}libsycl-crt.new.o
171+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-complex.
172+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-complex-fp64.
173+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-cmath.new.o
174+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-cmath-fp64.new.o
175+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-imf.new.o
176+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-imf-fp64.new.o
177+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-imf-bf16.new.o
178+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-cassert.new.o
179+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-cstring.new.o
180+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-complex.new.o
181+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-complex-fp64.new.o
182+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-cmath.new.o
183+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-cmath-fp64.new.o
184+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-imf.new.o
185+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o
186+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o
187+
// SYCL_DEVICE_LIB_ASAN-SAME: {{.*}}libsycl-asan.new.o
188188
// SYCL_DEVICE_ASAN_MACRO: "-cc1"
189189
// SYCL_DEVICE_ASAN_MACRO-SAME: "USE_SYCL_DEVICE_ASAN"
190190
// SYCL_DEVICE_ASAN_MACRO: libsycl-asan.new.o
@@ -314,3 +314,41 @@
314314
// SYCL_DEVICE_LIB_ASAN_MUL-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o
315315
// SYCL_DEVICE_LIB_ASAN_MUL-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o
316316
// SYCL_DEVICE_LIB_ASAN_MUL-SAME: {{.*}}libsycl-asan.new.o
317+
318+
319+
/// ###########################################################################
320+
/// test behavior of libsycl-msan.o linking when -fsanitize=memory is available
321+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -fsanitize=memory -### 2>&1 \
322+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
323+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend -fsanitize=memory -### 2>&1 \
324+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
325+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xsycl-target-frontend=spir64 -fsanitize=memory -### 2>&1 \
326+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
327+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device -fsanitize=memory -### 2>&1 \
328+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
329+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=memory -DUSE_SYCL_DEVICE_MSAN" -### 2>&1 \
330+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_LIB_MSAN
331+
// RUN: %clangxx -fsycl --offload-new-driver %s --sysroot=%S/Inputs/SYCL -Xarch_device "-fsanitize=memory -DUSE_SYCL_DEVICE_MSAN" -### 2>&1 \
332+
// RUN: | FileCheck %s -check-prefix=SYCL_DEVICE_MSAN_MACRO
333+
// SYCL_DEVICE_LIB_MSAN: clang-linker-wrapper{{.*}} "-sycl-device-libraries
334+
// SYCL_DEVICE_LIB_MSAN: {{.*}}libsycl-crt.new.o
335+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-complex.
336+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-complex-fp64.
337+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-cmath.new.o
338+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-cmath-fp64.new.o
339+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-imf.new.o
340+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-imf-fp64.new.o
341+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-imf-bf16.new.o
342+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-cassert.new.o
343+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-cstring.new.o
344+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-complex.new.o
345+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-complex-fp64.new.o
346+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-cmath.new.o
347+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-cmath-fp64.new.o
348+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-imf.new.o
349+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-imf-fp64.new.o
350+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-fallback-imf-bf16.new.o
351+
// SYCL_DEVICE_LIB_MSAN-SAME: {{.*}}libsycl-msan.new.o
352+
// SYCL_DEVICE_MSAN_MACRO: "-cc1"
353+
// SYCL_DEVICE_MSAN_MACRO-SAME: "USE_SYCL_DEVICE_MSAN"
354+
// SYCL_DEVICE_MSAN_MACRO: libsycl-msan.new.o

clang/test/Driver/sycl-device-sanitizer.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// ###########################################################################
2+
13
// RUN: %clangxx -fsycl -fsanitize=address -c %s -### 2>&1 \
24
// RUN: | FileCheck --check-prefix=SYCL-ASAN %s
35
// SYCL-ASAN: clang{{.*}} "-fsycl-is-device"
@@ -13,9 +15,9 @@
1315
// SYCL-ASAN-SAME: "-mllvm" "-asan-mapping-scale=4"
1416

1517
// RUN: %clangxx -fsycl -Xarch_device -fsanitize=address -c %s -### 2>&1 \
16-
// RUN: | FileCheck --check-prefix=SYCL-XARCH-DEVICE %s
17-
// SYCL-XARCH-DEVICE: clang{{.*}} "-fsycl-is-device"
18-
// SYCL-XARCH-DEVICE-SAME: -fsanitize=address
18+
// RUN: | FileCheck --check-prefix=SYCL-ASAN-XARCH-DEVICE %s
19+
// SYCL-ASAN-XARCH-DEVICE: clang{{.*}} "-fsycl-is-device"
20+
// SYCL-ASAN-XARCH-DEVICE-SAME: -fsanitize=address
1921

2022
// RUN: %clangxx -fsycl -Xarch_device -fsanitize=address -Xarch_device -fsanitize-recover=address -c %s -### 2>&1 \
2123
// RUN: | FileCheck --check-prefix=SYCL-ASAN-RECOVER %s
@@ -30,3 +32,16 @@
3032
// SYCL-ASAN-FILTER: clang{{.*}} "-fsycl-is-device"
3133
// SYCL-ASAN-FILTER-SAME: -fsanitize=address
3234
// SYCL-ASAN-FILTER-SAME: "-mllvm" "-asan-stack=0"
35+
36+
/// ###########################################################################
37+
38+
// RUN: %clangxx -fsycl -fsanitize=memory -c %s -### 2>&1 \
39+
// RUN: | FileCheck --check-prefix=SYCL-MSAN %s
40+
// SYCL-MSAN: clang{{.*}} "-fsycl-is-device"
41+
// SYCL-MSAN-SAME: -fsanitize=memory
42+
// SYCL-MSAN-SAME: "-mllvm" "-msan-instrumentation-with-call-threshold=0"
43+
44+
// RUN: %clangxx -fsycl -Xarch_device -fsanitize=memory -c %s -### 2>&1 \
45+
// RUN: | FileCheck --check-prefix=SYCL-MSAN-XARCH-DEVICE %s
46+
// SYCL-MSAN-XARCH-DEVICE: clang{{.*}} "-fsycl-is-device"
47+
// SYCL-MSAN-XARCH-DEVICE-SAME: -fsanitize=memory

0 commit comments

Comments
 (0)