[compiler-rt] [compiler-rt][tests] Removed the use of parentheses in compiler-rt tests with lit internal shell (PR #105729)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 08:16:30 PDT 2024
https://github.com/Harini0924 updated https://github.com/llvm/llvm-project/pull/105729
>From d9b4243718b39e1c03db97a26b8bee528aba2f28 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 22 Aug 2024 20:32:39 +0000
Subject: [PATCH 1/3] [llvm-lit] Remove unsupported subshell execution in
compiler-rt tests
Updated `merge-posix.test` and `vptr.cpp` to remove the use of parentheses for subshell execution in the RUN lines, ensuring compatibility with the lit internal shell.
---
compiler-rt/test/fuzzer/merge-posix.test | 3 ++-
compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test
index 9fece647ca60b9..597e2dd3c2791f 100644
--- a/compiler-rt/test/fuzzer/merge-posix.test
+++ b/compiler-rt/test/fuzzer/merge-posix.test
@@ -17,7 +17,8 @@ RUN: echo ....E. > %tmp/T2/5
RUN: echo .....R > %tmp/T2/6
# Check that we can report an error if file size exceeded
-RUN: (ulimit -f 1; not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ)
+RUN: ulimit -f 1
+RUN: not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ
SIGXFSZ: ERROR: libFuzzer: file size exceeded
# Check that we honor TMPDIR
diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
index 2d0e48cd84f3cf..b1242197caf75c 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
@@ -23,7 +23,9 @@
// RUN: %env_ubsan_opts=halt_on_error=1 not %run %t nN 2>&1 | FileCheck %s --check-prefix=CHECK-NULL-MEMFUN --strict-whitespace
// RUN: %env_ubsan_opts=print_stacktrace=1 %run %t dT 2>&1 | FileCheck %s --check-prefix=CHECK-DYNAMIC --allow-unused-prefixes --check-prefix=CHECK-%os-DYNAMIC --strict-whitespace
-// RUN: (echo "vptr_check:S"; echo "vptr_check:T"; echo "vptr_check:U") > %t.supp
+// RUN: echo "vptr_check:S" > %t.supp
+// RUN: echo "vptr_check:T" >> %t.supp
+// RUN: echo "vptr_check:U" >> %t.supp
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t mS
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t fS
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t cS
>From 7c8bdf9d665150536c188ba261a68104cbe20908 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Fri, 23 Aug 2024 16:28:19 +0000
Subject: [PATCH 2/3] Reverted `merge-posix.test` file back to its original
state
---
compiler-rt/test/fuzzer/merge-posix.test | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test
index 597e2dd3c2791f..9fece647ca60b9 100644
--- a/compiler-rt/test/fuzzer/merge-posix.test
+++ b/compiler-rt/test/fuzzer/merge-posix.test
@@ -17,8 +17,7 @@ RUN: echo ....E. > %tmp/T2/5
RUN: echo .....R > %tmp/T2/6
# Check that we can report an error if file size exceeded
-RUN: ulimit -f 1
-RUN: not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ
+RUN: (ulimit -f 1; not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ)
SIGXFSZ: ERROR: libFuzzer: file size exceeded
# Check that we honor TMPDIR
>From 761248f8c0c8413a0bbbe622ae7912c19a9b8a7b Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Mon, 26 Aug 2024 15:14:06 +0000
Subject: [PATCH 3/3] Simplify suppression file creation by using a single echo
command
Simplified the suppression file creation in the test script by combining multiple RUN lines into a single echo command using the -e option. This change reduces redundancy, improves readability, and makes the script more efficient by creating the suppression file with all necessary entries in one step.
---
compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
index b1242197caf75c..4f2a5e65005edf 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
@@ -23,9 +23,7 @@
// RUN: %env_ubsan_opts=halt_on_error=1 not %run %t nN 2>&1 | FileCheck %s --check-prefix=CHECK-NULL-MEMFUN --strict-whitespace
// RUN: %env_ubsan_opts=print_stacktrace=1 %run %t dT 2>&1 | FileCheck %s --check-prefix=CHECK-DYNAMIC --allow-unused-prefixes --check-prefix=CHECK-%os-DYNAMIC --strict-whitespace
-// RUN: echo "vptr_check:S" > %t.supp
-// RUN: echo "vptr_check:T" >> %t.supp
-// RUN: echo "vptr_check:U" >> %t.supp
+// RUN: echo -e "vptr_check:S\nvptr_check:T\nvptr_check:U" > %t.supp
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t mS
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t fS
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.supp"' %run %t cS
More information about the llvm-commits
mailing list