[compiler-rt] 8240552 - [compiler-rt] Update test to export variables instead of using env
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 16 00:14:00 PST 2025
Author: Aiden Grossman
Date: 2025-11-16T08:13:48Z
New Revision: 8240552e8886e5abc5bbe957d848ed7dba5e8725
URL: https://github.com/llvm/llvm-project/commit/8240552e8886e5abc5bbe957d848ed7dba5e8725
DIFF: https://github.com/llvm/llvm-project/commit/8240552e8886e5abc5bbe957d848ed7dba5e8725.diff
LOG: [compiler-rt] Update test to export variables instead of using env
To work around a bug in lit's internal test runner around ulimit.
Commands that use env to set environment variables for that command do
not have limits applied to them. This needs to be fixed, but for now we
can work around without degrading the readability of the test too much.
Added:
Modified:
compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
index f60a6a4ef79e6..c51e11fcb348a 100644
--- a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
@@ -7,25 +7,37 @@
// Limit this test to Linux since we're relying on allocator internal
// limits (shadow memory size, allocation limits etc.)
+// TODO(boomanaiden154): Switch back to using env options instead of explicitly
+// exporting when the underlying bug causing ulimits to not apply to run lines
+// that use env options is fixed.
+
// RUN: %clangxx_asan -O0 %s -o %t
// RUN: ulimit -v 22024290304
// RUN: not %run %t malloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH
-// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=0
+// RUN: not %run %t malloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH
-// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t malloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=1
+// RUN: %run %t malloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-NULL
-// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=0
+// RUN: not %run %t calloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-CRASH
-// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=1
+// RUN: %run %t calloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-NULL
-// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=0
+// RUN: not %run %t realloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-CRASH
-// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=1
+// RUN: %run %t realloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-NULL
-// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=0
+// RUN: not %run %t realloc-after-malloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-CRASH
-// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 \
+// RUN: %export_asan_opts=allocator_may_return_null=1
+// RUN: %run %t realloc-after-malloc 2>&1 \
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-NULL
// ASan shadow memory on s390 is too large for this test.
More information about the llvm-commits
mailing list