diff --git a/sycl/test-e2e/AddressSanitizer/common/config-red-zone-size.cpp b/sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp similarity index 100% rename from sycl/test-e2e/AddressSanitizer/common/config-red-zone-size.cpp rename to sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp diff --git a/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp new file mode 100644 index 0000000000000..a6e3ef21d0567 --- /dev/null +++ b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp @@ -0,0 +1,39 @@ +// REQUIRES: linux +// RUN: %{build} %device_asan_flags -O0 -g -o %t +// RUN: %{run} %t + +// Invalid ur option format +// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-FORMAT +// INVALID-FORMAT: [ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value + +// Invalid bool option +// RUN: env UR_LAYER_ASAN_OPTIONS=debug:yes %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-BOOL +// INVALID-BOOL: [ERROR]: "debug" is set to "yes", which is not an valid setting. Acceptable input are: for enable, use: "1" "true"; for disable, use: "0" "false". + +// Invalid quarantine_size_mb +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:-1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-QUARANTINE +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:4294967296 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-QUARANTINE +// INVALID-QUARANTINE: [ERROR]: "quarantine_size_mb" should be an integer in range[0, 4294967295]. + +// Invalid redzone and max_redzone +// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-REDZONE +// INVALID-REDZONE: [ERROR]: "redzone" should be an integer in range[0, 16]. +// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-MAXREDZONE +// INVALID-MAXREDZONE: [ERROR]: "max_redzone" should be an integer in range[0, 2048]. + + + +#include + +int main() { + sycl::queue q; + constexpr std::size_t N = 8; + auto *array = sycl::malloc_device(N, q); + + q.submit([&](sycl::handler &h) { + h.single_task([=]() { ++array[0]; }); + }).wait(); + + sycl::free(array, q); + return 0; +}