From 011ddea5efb03cc20c176a5f5f118a9c9de3384f Mon Sep 17 00:00:00 2001 From: Connie Zhu 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 05b55f9e3fcc2..0ac7558b4e99b 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 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 0ac7558b4e99b..7e20dc660b4e0 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 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 7e20dc660b4e0..fc7bb412da973 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 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 fc7bb412da973..7131ec3220425 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'