[compiler-rt] [compiler-rt][test] Rewrote test to remove curly braces (PR #105696)
Connie Zhu via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 09:34:55 PDT 2024
https://github.com/connieyzhu updated https://github.com/llvm/llvm-project/pull/105696
>From 011ddea5efb03cc20c176a5f5f118a9c9de3384f Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Thu, 22 Aug 2024 16:54:06 +0000
Subject: [PATCH 1/4] [compiler-rt][test] Rewrote test to remove curly braces
This patch removes curly braces from a test, as lit's internal shell
implementation does not support curly brace syntax.
---
compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
index 05b55f9e3fcc28..0ac7558b4e99bb 100644
--- a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
+++ b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
@@ -1,7 +1,7 @@
// RUN: %clangxx_asan -xc++ -shared -fPIC -o %t.so - < %s
// RUN: %clang_asan %s -o %t.out -ldl
//
-// RUN: { env ASAN_OPTIONS=verbosity=1 %t.out %t.so || : ; } 2>&1 | FileCheck %s
+// RUN: env ASAN_OPTIONS=verbosity=1 %t.out %t.so 2>&1 | FileCheck %s || :
//
// CHECK: AddressSanitizer: failed to intercept '__cxa_throw'
//
>From 8272fec56517bb8deca86d9f5aa8b9e4d1c571fa Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Sat, 24 Aug 2024 00:43:22 +0000
Subject: [PATCH 2/4] [compiler-rt][test] Fix incorrect logic with using '|| :'
in test
This patch fixes incorrect usage of '|| :', which modified the function
of the original test. '|| :' should be used with the env command, and
not with FileCheck.
---
compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
index 0ac7558b4e99bb..7e20dc660b4e03 100644
--- a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
+++ b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
@@ -1,7 +1,10 @@
// RUN: %clangxx_asan -xc++ -shared -fPIC -o %t.so - < %s
// RUN: %clang_asan %s -o %t.out -ldl
//
-// RUN: env ASAN_OPTIONS=verbosity=1 %t.out %t.so 2>&1 | FileCheck %s || :
+// The program can potentially return a non-zero exit code, so use || : to
+// ensure command returns true
+// RUN: env ASAN_OPTIONS=verbosity=1 %t.out %t.so &> %t_env || :
+// RUN: FileCheck %s < %t_env
//
// CHECK: AddressSanitizer: failed to intercept '__cxa_throw'
//
>From 62a9a4bdd589e8abf8c6bbf920b941c446c18536 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Wed, 28 Aug 2024 00:59:19 +0000
Subject: [PATCH 3/4] [compiler-rt][test] Replaced ||: with not
---
compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
index 7e20dc660b4e03..fc7bb412da9735 100644
--- a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
+++ b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
@@ -3,8 +3,7 @@
//
// The program can potentially return a non-zero exit code, so use || : to
// ensure command returns true
-// RUN: env ASAN_OPTIONS=verbosity=1 %t.out %t.so &> %t_env || :
-// RUN: FileCheck %s < %t_env
+// RUN: env ASAN_OPTIONS=verbosity=1 not %t.out %t.so 2>&1 | FileCheck %s
//
// CHECK: AddressSanitizer: failed to intercept '__cxa_throw'
//
>From 34ec36cff0672e252df38c548639ac60d0ec7a29 Mon Sep 17 00:00:00 2001
From: Connie Zhu <connieyzhu at google.com>
Date: Wed, 28 Aug 2024 16:34:13 +0000
Subject: [PATCH 4/4] [NFC] Removed stale comment
---
compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
index fc7bb412da9735..7131ec3220425d 100644
--- a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
+++ b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
@@ -1,8 +1,6 @@
// RUN: %clangxx_asan -xc++ -shared -fPIC -o %t.so - < %s
// RUN: %clang_asan %s -o %t.out -ldl
//
-// The program can potentially return a non-zero exit code, so use || : to
-// ensure command returns true
// RUN: env ASAN_OPTIONS=verbosity=1 not %t.out %t.so 2>&1 | FileCheck %s
//
// CHECK: AddressSanitizer: failed to intercept '__cxa_throw'
More information about the llvm-commits
mailing list