From 04f363021e393d96c15a3f3a83637280b3c93ceb Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Wed, 25 Jun 2025 11:01:05 +0200 Subject: [PATCH 1/3] fix test --- .../MemorySanitizer/track-origins/check_host_usm.cpp | 10 +++++----- .../check_host_usm_initialized_on_host.cpp | 4 +++- .../track-origins/check_kernel_memmove_no_overlap.cpp | 4 +++- .../track-origins/check_kernel_memmove_overlap.cpp | 4 +++- .../MemorySanitizer/track-origins/check_shared_usm.cpp | 6 +++--- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp index 7d032e233beed..7763d37a00f64 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp @@ -1,10 +1,10 @@ // REQUIRES: linux, cpu || (gpu && level_zero) -// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s +// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t1.out +// RUN: %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O1 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s +// RUN: %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t3.out -// RUN: %{run} %t3.out 2>&1 | FileCheck %s +// RUN: %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK // RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:0 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK-HOSTUSM #include @@ -25,7 +25,7 @@ int main() { // CHECK: kernel <{{.*MyKernel}}> // CHECK: #{{.*}} {{.*check_host_usm.cpp}}:[[@LINE-6]] // CHECK: ORIGIN: Host USM allocation - // CHECK: #{{.*}} {{.*check_host_usm.cpp}}:[[@LINE-11]] + // CHECK-ORIGIN-STACK: #{{.*}} {{.*check_host_usm.cpp}}:[[@LINE-11]] // CHECK-HOSTUSM-NOT: use-of-uninitialized-value sycl::free(array, Q); diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp index 55fb7578de043..0337b7f30060c 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp @@ -1,4 +1,6 @@ // REQUIRES: linux, cpu || (gpu && level_zero) +// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out +// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out // RUN: %{run} %t1.out 2>&1 | FileCheck %s // RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:0 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK-HOSTUSM @@ -22,7 +24,7 @@ int main() { // CHECK: kernel <{{.*MyKernel}}> // CHECK: #{{.*}} {{.*check_host_usm_initialized_on_host.cpp}}:[[@LINE-6]] // CHECK: ORIGIN: Host USM allocation - // CHECK: #{{.*}} {{.*check_host_usm_initialized_on_host.cpp}}:[[@LINE-12]] + // CHECK-ORIGIN-STACK: #{{.*}} {{.*check_host_usm_initialized_on_host.cpp}}:[[@LINE-12]] // CHECK-HOSTUSM-NOT: use-of-uninitialized-value sycl::free(array, Q); diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp index 87db3461bb1ad..91bc1d7f31571 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp @@ -1,4 +1,6 @@ // REQUIRES: linux, cpu || (gpu && level_zero) +// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out +// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out // RUN: %{run} %t1.out 2>&1 | FileCheck %s // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -DINIT_SOURCE -O2 -g -o %t2.out @@ -36,7 +38,7 @@ void no_overlap() { // CHECK: kernel <{{.*MyKernel3}}> // CHECK: #{{.*}} {{.*check_kernel_memmove_no_overlap.cpp}}:[[@LINE-6]] // CHECK: ORIGIN: Host USM allocation - // CHECK: #{{.*}} {{.*check_kernel_memmove_no_overlap.cpp}}:[[@LINE-24]] + // CHECK-ORIGIN-STACK: #{{.*}} {{.*check_kernel_memmove_no_overlap.cpp}}:[[@LINE-24]] // CHECK-INIT-NOT: use-of-uninitialized-value sycl::free(array1, Q); diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp index f0a15e52f387a..1afd313f4bfe7 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp @@ -1,4 +1,6 @@ // REQUIRES: linux, cpu || (gpu && level_zero) +// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out +// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out // RUN: %{run} %t1.out 2>&1 | FileCheck %s @@ -30,7 +32,7 @@ void overlap() { // CHECK: kernel <{{.*MyKernel2}}> // CHECK: #{{.*}} {{.*check_kernel_memmove_overlap.cpp}}:[[@LINE-6]] // CHECK: ORIGIN: Shared USM allocation - // CHECK: #{{.*}} {{.*check_kernel_memmove_overlap.cpp}}:[[@LINE-20]] + // CHECK-ORIGIN-STACK: #{{.*}} {{.*check_kernel_memmove_overlap.cpp}}:[[@LINE-20]] sycl::free(array, Q); } diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp index 4f5a79772c1e8..be9df84b6d5a2 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp @@ -1,6 +1,6 @@ // REQUIRES: linux, cpu || (gpu && level_zero) -// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s +// RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t1.out +// RUN: %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O1 -g -o %t2.out // RUN: %{run} %t2.out 2>&1 | FileCheck %s // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t3.out @@ -25,7 +25,7 @@ int main() { // CHECK: kernel <{{.*MyKernel}}> // CHECK: #{{.*}} {{.*check_shared_usm.cpp}}:[[@LINE-6]] // CHECK: ORIGIN: Shared USM allocation - // CHECK: #{{.*}} {{.*check_shared_usm.cpp}}:[[@LINE-11]] + // CHECK-ORIGIN-STACK: #{{.*}} {{.*check_shared_usm.cpp}}:[[@LINE-11]] // CHECK-SHAREDUSM-NOT: use-of-uninitialized-value sycl::free(array, Q); From dbb3aa1fc0725025f00ca0234124382c1ae148e2 Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Thu, 26 Jun 2025 05:31:49 +0200 Subject: [PATCH 2/3] add env --- .../MemorySanitizer/track-origins/check_host_usm.cpp | 6 +++--- .../track-origins/check_host_usm_initialized_on_host.cpp | 4 ++-- .../MemorySanitizer/track-origins/check_kernel_memcpy.cpp | 4 ++-- .../track-origins/check_kernel_memmove_no_overlap.cpp | 6 +++--- .../track-origins/check_kernel_memmove_overlap.cpp | 4 ++-- .../MemorySanitizer/track-origins/check_shared_usm.cpp | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp index 7763d37a00f64..e370ff0de509e 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm.cpp @@ -1,10 +1,10 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O1 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t3.out -// RUN: %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK // RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:0 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK-HOSTUSM #include diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp index 0337b7f30060c..eb732846fdbac 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_host_usm_initialized_on_host.cpp @@ -1,8 +1,8 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out -// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s // RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:0 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK-HOSTUSM #include diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memcpy.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memcpy.cpp index 3669242af2e45..dcc5de9dcf496 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memcpy.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memcpy.cpp @@ -1,8 +1,8 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -DINIT_SOURCE -O2 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK-INIT +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK-INIT #include #include diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp index 91bc1d7f31571..3d28c2a3af4c3 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_no_overlap.cpp @@ -1,10 +1,10 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out -// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -DINIT_SOURCE -O2 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK-INIT +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t2.out 2>&1 | FileCheck %s --check-prefixes CHECK-INIT #include #include diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp index 1afd313f4bfe7..7a75aa1871c93 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_kernel_memmove_overlap.cpp @@ -1,8 +1,8 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t0.out -// RUN: %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s #include #include diff --git a/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp b/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp index be9df84b6d5a2..e936227bda78f 100644 --- a/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp +++ b/sycl/test-e2e/MemorySanitizer/track-origins/check_shared_usm.cpp @@ -1,10 +1,10 @@ // REQUIRES: linux, cpu || (gpu && level_zero) // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O0 -g -o %t1.out -// RUN: %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes CHECK,CHECK-ORIGIN-STACK // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O1 -g -o %t2.out -// RUN: %{run} %t2.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t2.out 2>&1 | FileCheck %s // RUN: %{build} %device_msan_flags -Xarch_device -fsanitize-memory-track-origins=1 -O2 -g -o %t3.out -// RUN: %{run} %t3.out 2>&1 | FileCheck %s +// RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:1 %{run} %t3.out 2>&1 | FileCheck %s // RUN: env UR_LAYER_MSAN_OPTIONS=msan_check_host_and_shared_usm:0 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes CHECK-SHAREDUSM #include From a12ee2a378549f335ad7e62e4ef0c130b18531bf Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Thu, 26 Jun 2025 06:59:10 +0200 Subject: [PATCH 3/3] empty commit