[ubsan][test] Enable Misc/Linux tests on all Posix systems#111497
[ubsan][test] Enable Misc/Linux tests on all Posix systems#111497
Conversation
When investigating PR llvm#101634, it turned out that `UBSan-Standalone-sparc :: TestCases/Misc/Linux/diag-stacktrace.cpp` isn't Linux-specific at all. In fact, none of the `ubsan/TestCases/Misc/Linux` tests are. Therefore this patch moves them to `Misc/Posix` instead. Tested on `sparc64-unknown-linux-gnu`, `sparcv9-sun-solaris2.11`, `x86_64-pc-linux-gnu`, and `amd64-pc-solaris2.11`.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Rainer Orth (rorth) ChangesWhen investigating PR #101634, it turned out that Therefore this patch moves them to Tested on Full diff: https://github.com/llvm/llvm-project/pull/111497.diff 6 Files Affected:
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/diag-stacktrace.cpp
similarity index 100%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/diag-stacktrace.cpp
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py b/compiler-rt/test/ubsan/TestCases/Misc/Posix/lit.local.cfg.py
similarity index 82%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/lit.local.cfg.py
index 603ca0365068f5..63240c39625656 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Posix/lit.local.cfg.py
@@ -6,5 +6,5 @@ def getRoot(config):
root = getRoot(config)
-if root.host_os not in ["Linux"]:
+if root.host_os in ["Windows"]:
config.unsupported = True
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp
similarity index 100%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/sigaction.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/sigaction.cpp
similarity index 100%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/sigaction.cpp
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/sigaction.cpp
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp
similarity index 100%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/static-link.cpp
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp
similarity index 100%
rename from compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cpp
rename to compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp
|
You can test this locally with the following command:git-clang-format --diff a3a253d3c7780977077dd46493917b1949c0166d a5868ab1f3d4329efa767d0b3fd6a35b3d93d864 --extensions cpp -- compiler-rt/test/ubsan/TestCases/Misc/Posix/diag-stacktrace.cpp compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp compiler-rt/test/ubsan/TestCases/Misc/Posix/sigaction.cpp compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cppView the diff from clang-format here.diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp
index 93c6bd66e1..66907be0bb 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Posix/print_stack_trace.cpp
@@ -10,9 +10,7 @@
#include <sanitizer/common_interface_defs.h>
-static inline void FooBarBaz() {
- __sanitizer_print_stack_trace();
-}
+static inline void FooBarBaz() { __sanitizer_print_stack_trace(); }
int main() {
FooBarBaz();
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp
index 284b4ba0ab..f8018a3b84 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_options.cpp
@@ -6,13 +6,10 @@
#include <stdint.h>
-extern "C" const char *__ubsan_default_options() {
- return "halt_on_error=1";
-}
+extern "C" const char *__ubsan_default_options() { return "halt_on_error=1"; }
int main() {
(void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
// CHECK: ubsan_options.cpp:[[@LINE-1]]:44: runtime error: unsigned integer overflow
return 0;
}
-
|
|
I don't think it's a good idea to perform |
|
Ping? It's been a week. |
When investigating PR llvm#101634, it turned out that `UBSan-Standalone-sparc :: TestCases/Misc/Linux/diag-stacktrace.cpp` isn't Linux-specific at all. In fact, none of the `ubsan/TestCases/Misc/Linux` tests are. Therefore this patch moves them to `Misc/Posix` instead. Tested on `sparc64-unknown-linux-gnu`, `sparcv9-sun-solaris2.11`, `x86_64-pc-linux-gnu`, and `amd64-pc-solaris2.11`.
After #111497 the test started unexpectedly passing (https://crbug.com/373891811), probably because it does actually work but wasn't run when it lived in the Misc/Linux/ directory.
|
@zmodem @rorth https://ci.chromium.org/ui/p/chromium/builders/try/mac_upload_clang/5978/overview |
When investigating PR #101634, it turned out that
UBSan-Standalone-sparc :: TestCases/Misc/Linux/diag-stacktrace.cppisn't Linux-specific at all. In fact, none of theubsan/TestCases/Misc/Linuxtests are.Therefore this patch moves them to
Misc/Posixinstead.Tested on
sparc64-unknown-linux-gnu,sparcv9-sun-solaris2.11,x86_64-pc-linux-gnu, andamd64-pc-solaris2.11.