-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[compiler-rt][test] Rewrote test to remove curly braces #105696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-rt][test] Rewrote test to remove curly braces #105696
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Connie Zhu (connieyzhu) ChangesThis patch removes curly braces from a test, as lit's internal shell implementation does not support curly brace syntax. Full diff: https://github.com/llvm/llvm-project/pull/105696.diff 1 Files Affected:
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..f17d2c9324d219 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'
//
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This patch removes curly braces from a test, as lit's internal shell implementation does not support curly brace syntax.
@@ -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 || : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these are equivalent, and we probably don't want to change the return code for FileCheck
, since we still want CHECK lines to trigger a failure. It seems that this program will always return a non-zero exit code, so maybe we can just use not
instead of || :
? Alternatively, we could make the program return 0
, but I'm guessing the author were worried about some optimization preventing the test from working correctly, and I'm not familar enough w/ this test to know if that would be problematic.
bf13596
to
011ddea
Compare
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.
// 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 || : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial version of this commit used not
: cbd28cd but for some reason that was changed in a30a4a3
Maybe removing not
was used to work around the missing UNSUPPORTED:
that was only added in 307daa7 CC: @serge-sans-paille @hahnjo
I'd be tempted to restore this to using not
instead of || :
and see if the builders are happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced ||:
with not
in my most recent commit. The tests are passing when I run things locally - still need to wait for builders though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment needs updating otherwise LGTM
@@ -1,7 +1,9 @@ | |||
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale comment here.
This patch removes curly braces from a test, as lit's internal shell implementation does not support curly brace syntax.
Fixes #102382.