Skip to content

Commit a3cd8ed

Browse files
boomanaiden154github-actions[bot]
authored andcommitted
Automerge: [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.
2 parents 63e2cd8 + 8240552 commit a3cd8ed

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,37 @@
77
// Limit this test to Linux since we're relying on allocator internal
88
// limits (shadow memory size, allocation limits etc.)
99

10+
// TODO(boomanaiden154): Switch back to using env options instead of explicitly
11+
// exporting when the underlying bug causing ulimits to not apply to run lines
12+
// that use env options is fixed.
13+
1014
// RUN: %clangxx_asan -O0 %s -o %t
1115
// RUN: ulimit -v 22024290304
1216
// RUN: not %run %t malloc 2>&1 \
1317
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH
14-
// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t malloc 2>&1 \
18+
// RUN: %export_asan_opts=allocator_may_return_null=0
19+
// RUN: not %run %t malloc 2>&1 \
1520
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-CRASH
16-
// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t malloc 2>&1 \
21+
// RUN: %export_asan_opts=allocator_may_return_null=1
22+
// RUN: %run %t malloc 2>&1 \
1723
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC,CHECK-NULL
18-
// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t calloc 2>&1 \
24+
// RUN: %export_asan_opts=allocator_may_return_null=0
25+
// RUN: not %run %t calloc 2>&1 \
1926
// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-CRASH
20-
// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t calloc 2>&1 \
27+
// RUN: %export_asan_opts=allocator_may_return_null=1
28+
// RUN: %run %t calloc 2>&1 \
2129
// RUN: | FileCheck %s --check-prefixes=CHECK-CALLOC,CHECK-NULL
22-
// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc 2>&1 \
30+
// RUN: %export_asan_opts=allocator_may_return_null=0
31+
// RUN: not %run %t realloc 2>&1 \
2332
// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-CRASH
24-
// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc 2>&1 \
33+
// RUN: %export_asan_opts=allocator_may_return_null=1
34+
// RUN: %run %t realloc 2>&1 \
2535
// RUN: | FileCheck %s --check-prefixes=CHECK-REALLOC,CHECK-NULL
26-
// RUN: %env_asan_opts=allocator_may_return_null=0 not %run %t realloc-after-malloc 2>&1 \
36+
// RUN: %export_asan_opts=allocator_may_return_null=0
37+
// RUN: not %run %t realloc-after-malloc 2>&1 \
2738
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-CRASH
28-
// RUN: %env_asan_opts=allocator_may_return_null=1 %run %t realloc-after-malloc 2>&1 \
39+
// RUN: %export_asan_opts=allocator_may_return_null=1
40+
// RUN: %run %t realloc-after-malloc 2>&1 \
2941
// RUN: | FileCheck %s --check-prefixes=CHECK-MALLOC-REALLOC,CHECK-NULL
3042

3143
// ASan shadow memory on s390 is too large for this test.

0 commit comments

Comments
 (0)