[clang] [OpenMP][ASan][Driver] Update build steps for OpenMP ASan. (PR #179636)

Amit Kumar Pandey via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 03:15:17 PST 2026


================
@@ -9,7 +9,7 @@
 // RUN:   | FileCheck --check-prefixes=NOTSUPPORTED,FAIL %s
 
 // Memory, Leak, UndefinedBehaviour and Thread Sanitizer are not supported on AMDGPU.
-// RUN:   %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fsanitize=leak -fgpu-sanitize --rocm-path=%S/Inputs/rocm -nogpuinc  %s 2>&1 \
+// RUN:   not %clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fsanitize=leak -fgpu-sanitize --rocm-path=%S/Inputs/rocm -nogpuinc  %s 2>&1 \
----------------
ampandey-1995 wrote:

Actually, these lit tests static check for error diagnostics as certain kind of sanitizers like leak and memory are not supported for AMDGPU so only allow them for host.

Without `not` the clang returns non-zero exit status with error diagnostics and `FileCheck` will fail since it expects the exit status to be zero.

```
# RUN: at line 12
/home/ampandey/trunk-toolchain/build/llvm-project/bin/clang -no-canonical-prefixes -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fsanitize=leak -fgpu-sanitize --rocm-path=/home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/Inputs/rocm -nogpuinc  /home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/amdgpu-openmp-sanitize-options.c 2>&1    | /home/ampandey/trunk-toolchain/build/llvm-project/bin/FileCheck --check-prefix=NOTSUPPORTED /home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/amdgpu-openmp-sanitize-options.c
# executed command: /home/ampandey/trunk-toolchain/build/llvm-project/bin/clang -no-canonical-prefixes '-###' --target=x86_64-unknown-linux-gnu -fopenmp=libomp --offload-arch=gfx908:xnack+ -fsanitize=address -fsanitize=leak -fgpu-sanitize --rocm-path=/home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/Inputs/rocm -nogpuinc /home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/amdgpu-openmp-sanitize-options.c
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /home/ampandey/trunk-toolchain/build/llvm-project/bin/FileCheck --check-prefix=NOTSUPPORTED /home/ampandey/trunk-toolchain/src-home/llvm-project/clang/test/Driver/amdgpu-openmp-sanitize-options.c

--

********************
********************
Failed Tests (2):
  Clang :: Driver/amdgpu-openmp-sanitize-options.c
  Clang :: Driver/sanitizer-ld.c


Testing Time: 27.81s

Total Discovered Tests: 50591
  Skipped          :     6 (0.01%)
  Unsupported      :  5012 (9.91%)
  Passed           : 45546 (90.03%)
  Expectedly Failed:    25 (0.05%)
  Failed           :     2 (0.00%)

```

https://github.com/llvm/llvm-project/pull/179636


More information about the cfe-commits mailing list