Skip to content

Commit 81cd735

Browse files
authored
[compiler-rt][test] Rewrote test to fix usage of export with 2 arguments (#106143)
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.
1 parent 6b86f51 commit 81cd735

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
// REQUIRES: x86_64-target-arch
77
// RUN: %clang_asan %s -o %t
8-
// RUN: export %env_asan_opts=print_scariness=1
9-
// RUN: not %run %t 0x0000000000000000 2>&1 | FileCheck %s --check-prefixes=ZERO,HINT-PAGE0
10-
// RUN: not %run %t 0x0000000000000FFF 2>&1 | FileCheck %s --check-prefixes=LOW1,HINT-PAGE0
11-
// RUN: not %run %t 0x0000000000001000 2>&1 | FileCheck %s --check-prefixes=LOW2,HINT-NONE
12-
// RUN: not %run %t 0x4141414141414141 2>&1 | FileCheck %s --check-prefixes=HIGH,HINT-HIGHADDR
13-
// RUN: not %run %t 0xFFFFFFFFFFFFFFFF 2>&1 | FileCheck %s --check-prefixes=MAX,HINT-HIGHADDR
8+
// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000000000 2>&1 | FileCheck %s --check-prefixes=ZERO,HINT-PAGE0
9+
// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000000FFF 2>&1 | FileCheck %s --check-prefixes=LOW1,HINT-PAGE0
10+
// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x0000000000001000 2>&1 | FileCheck %s --check-prefixes=LOW2,HINT-NONE
11+
// RUN: %env_asan_opts=print_scariness=1 not %run %t 0x4141414141414141 2>&1 | FileCheck %s --check-prefixes=HIGH,HINT-HIGHADDR
12+
// RUN: %env_asan_opts=print_scariness=1 not %run %t 0xFFFFFFFFFFFFFFFF 2>&1 | FileCheck %s --check-prefixes=MAX,HINT-HIGHADDR
1413

1514
#include <stdint.h>
1615
#include <stdlib.h>

0 commit comments

Comments
 (0)