Skip to content

[compiler-rt][test] Rewrote test to fix usage of export with 2 arguments #106143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

connieyzhu
Copy link
Contributor

This patch fixes the incorrect usage of lit's built-in export command in this compiler-rt test. The export command only allows for one argument, but %env_asan_opts expands to "env ASAN_OPTIONS", which gives export two arguments instead of only one. Instead of using export, which propogates the environment variable value to all subsequent commands, the environment variable is manually set before all RUN lines following the original export line.

This patch depends on #105961.

Fixes #106142.

This patch fixes the incorrect usage of lit's built-in export command in
this compiler-rt test. The export command only allows for one argument,
but %env_asan_opts expands to "env ASAN_OPTIONS", which gives export two
arguments instead of only one. Instead of using export, which propogates
the environment variable value to all subsequent commands, the
environment variable is manually set before all RUN lines following the
original export line.
@llvmbot
Copy link
Member

llvmbot commented Aug 26, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Connie Zhu (connieyzhu)

Changes

This patch fixes the incorrect usage of lit's built-in export command in this compiler-rt test. The export command only allows for one argument, but %env_asan_opts expands to "env ASAN_OPTIONS", which gives export two arguments instead of only one. Instead of using export, which propogates the environment variable value to all subsequent commands, the environment variable is manually set before all RUN lines following the original export line.

This patch depends on #105961.

Fixes #106142.


Full diff: https://github.com/llvm/llvm-project/pull/106143.diff

1 Files Affected:

  • (modified) compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c (+5-6)
diff --git a/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c b/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c
index 845e126d3f89b9..37a7b1702e982e 100644
--- a/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c
+++ b/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c
@@ -5,12 +5,11 @@
 
 // REQUIRES: x86_64-target-arch
 // RUN: %clang_asan %s -o %t
-// RUN: export %env_asan_opts=print_scariness=1
-// RUN: not %run %t 0x0000000000000000 2>&1 | FileCheck %s --check-prefixes=ZERO,HINT-PAGE0
-// RUN: not %run %t 0x0000000000000FFF 2>&1 | FileCheck %s --check-prefixes=LOW1,HINT-PAGE0
-// RUN: not %run %t 0x0000000000001000 2>&1 | FileCheck %s --check-prefixes=LOW2,HINT-NONE
-// RUN: not %run %t 0x4141414141414141 2>&1 | FileCheck %s --check-prefixes=HIGH,HINT-HIGHADDR
-// RUN: not %run %t 0xFFFFFFFFFFFFFFFF 2>&1 | FileCheck %s --check-prefixes=MAX,HINT-HIGHADDR
+// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000000000 2>&1 | FileCheck %s --check-prefixes=ZERO,HINT-PAGE0
+// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000000FFF 2>&1 | FileCheck %s --check-prefixes=LOW1,HINT-PAGE0
+// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000001000 2>&1 | FileCheck %s --check-prefixes=LOW2,HINT-NONE
+// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x4141414141414141 2>&1 | FileCheck %s --check-prefixes=HIGH,HINT-HIGHADDR
+// RUN: %env_asan_opts=print_scariness=1 not %run %t 0xFFFFFFFFFFFFFFFF 2>&1 | FileCheck %s --check-prefixes=MAX,HINT-HIGHADDR
 
 #include <stdint.h>
 #include <stdlib.h>

@connieyzhu connieyzhu merged commit 81cd735 into llvm:main Aug 27, 2024
11 checks passed
@connieyzhu connieyzhu deleted the compiler-rt-export branch August 27, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants