Skip to content

Commit 48730da

Browse files
[DeviceAsan][NFC] Fix ASan e2e tests, enable CPU or GPU tests (#15869)
fix #15461 - Update lit config to make sure tests will run on cpu or gpu device - disable GEN12 test --------- Co-authored-by: Steffen Larsen <[email protected]>
1 parent e95b34b commit 48730da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+57
-63
lines changed

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t
33
// RUN: %force_device_asan_rt %{run} not %t 2>&1 | FileCheck %s
44
#include <sycl/usm.hpp>

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-minus1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
33
// RUN: %force_device_asan_rt %{run} not %t1.out 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44
// RUN: %{build} %device_asan_flags -DMALLOC_HOST -O0 -g -o %t2.out

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-plus1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
33
// RUN: %force_device_asan_rt %{run} not %t1.out 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44
// RUN: %{build} %device_asan_flags -DMALLOC_HOST -O0 -g -o %t2.out

sycl/test-e2e/AddressSanitizer/common/demangle-kernel-name.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
33
// RUN: %{run} not %t &> %t.txt ; FileCheck --input-file %t.txt %s
44
#include <sycl/detail/core.hpp>

sycl/test-e2e/AddressSanitizer/common/kernel-debug.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-debug.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
3-
// RUN: env UR_LAYER_ASAN_OPTIONS=debug:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-DEBUG %s
43
// RUN: env UR_LAYER_ASAN_OPTIONS=debug:0 %{run} %t 2>&1 | FileCheck %s
54

65
#include <sycl/usm.hpp>
@@ -23,7 +22,6 @@ int main() {
2322
});
2423
});
2524
Q.wait();
26-
// CHECK-DEBUG: [kernel]
2725
// CHECK-NOT: [kernel]
2826

2927
sycl::free(array, Q);

sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-invalid-values.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t
33
// RUN: %{run} %t
44

5+
// clang-format off
56
// Invalid ur option format
67
// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-FORMAT
78
// INVALID-FORMAT: <SANITIZER>[ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value
@@ -20,8 +21,7 @@
2021
// INVALID-REDZONE: <SANITIZER>[ERROR]: "redzone" should be an integer in range[0, 16].
2122
// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-MAXREDZONE
2223
// INVALID-MAXREDZONE: <SANITIZER>[ERROR]: "max_redzone" should be an integer in range[0, 2048].
23-
24-
24+
// clang-format on
2525

2626
#include <sycl/usm.hpp>
2727

sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-redzone.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -DUNSAFE -O0 -g -o %t1.out
33
// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:64 %{run} not %t1.out 2>&1 | FileCheck %s
44
// RUN: %{build} %device_asan_flags -DSAFE -O0 -g -o %t2.out
5+
6+
// clang-format off
57
// RUN: env UR_LOG_SANITIZER=level:debug UR_LAYER_ASAN_OPTIONS=redzone:8 %{run} %t2.out 2>&1 | FileCheck --check-prefixes CHECK-MIN %s
68
// RUN: env UR_LOG_SANITIZER=level:debug UR_LAYER_ASAN_OPTIONS=max_redzone:4096 %{run} %t2.out 2>&1 | FileCheck --check-prefixes CHECK-MAX %s
9+
// clang-format on
710

811
#include <sycl/usm.hpp>
912

@@ -21,7 +24,7 @@ int main() {
2124
}).wait();
2225
// CHECK: ERROR: DeviceSanitizer: out-of-bounds-access on Device USM
2326
// CHECK: {{READ of size 1 at kernel <.*Test> LID\(0, 0, 0\) GID\(0, 0, 0\)}}
24-
// CHECK: {{ #0 .* .*option-redzone-size.cpp:}}[[@LINE-7]]
27+
// CHECK: {{ #0 .* .*options-redzone.cpp:}}[[@LINE-7]]
2528
// CHECK-MIN: Trying to set redzone size to a value less than 16 is ignored
2629
// CHECK-MAX: Trying to set max redzone size to a value greater than 2048 is ignored
2730

sycl/test-e2e/AddressSanitizer/common/statistics.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-statistics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
33
// RUN: %{run} %t 2>&1 | FileCheck %s
44
// RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s

sycl/test-e2e/AddressSanitizer/double-free/double-free.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
33
// RUN: %force_device_asan_rt UR_LAYER_ASAN_OPTIONS="quarantine_size_mb:1;detect_kernel_arguments:0" %{run} not %t1.out 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44
// RUN: %{build} %device_asan_flags -DMALLOC_HOST -O0 -g -o %t2.out

sycl/test-e2e/AddressSanitizer/invalid-argument/bad-context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux, (gpu && level_zero), cpu
1+
// REQUIRES: linux, cpu && (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -DMALLOC_DEVICE -O2 -g -o %t
33
// RUN: env SYCL_PREFER_UR=1 UR_LAYER_ASAN_OPTIONS="detect_kernel_arguments:1" %{run} not %t 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44

0 commit comments

Comments
 (0)