-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Augment uncaught-exception.test
fuzzer test to be msvc-compatible
#125924
base: main
Are you sure you want to change the base?
Augment uncaught-exception.test
fuzzer test to be msvc-compatible
#125924
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: David Justo (davidmrdavid) ChangesToday, the Although this is correct for This PR: augments this test so check for a different string (namely "libFuzzer: uncaught C++ exception") if the compiler target matches the I understand if this is outside the scope of support for LLVM as well, and I'm also open for different approaches here. Thanks! Full diff: https://github.com/llvm/llvm-project/pull/125924.diff 1 Files Affected:
diff --git a/compiler-rt/test/fuzzer/uncaught-exception.test b/compiler-rt/test/fuzzer/uncaught-exception.test
index b055c88f6d9039..d1b98cfb7c74ba 100644
--- a/compiler-rt/test/fuzzer/uncaught-exception.test
+++ b/compiler-rt/test/fuzzer/uncaught-exception.test
@@ -4,7 +4,10 @@
REQUIRES: windows
RUN: %cpp_compiler %S/UncaughtException.cpp -o %t-UncaughtException
-RUN: not %run %t-UncaughtException 2>&1 | FileCheck %s
+# Clang will fail the test with 'deadly signal', but other compilers may fail with different error messages.
+# For example, msvc fails with 'uncaught C++ exception'. So the error we check depends on the compiler target.
+RUN: not %run %t-UncaughtException 2>&1 | FileCheck %s --check-prefixes=CHECK-CRASH,%if target={{.*-windows-msvc.*}} %{CHECK-MSVC%} %else %{CHECK-ERROR%}
-CHECK: ERROR: libFuzzer: deadly signal
-CHECK: Test unit written to ./crash
+CHECK-ERROR: ERROR: libFuzzer: deadly signal
+CHECK-MSVC: ERROR: libFuzzer: uncaught C++ exception
+CHECK-CRASH: Test unit written to ./crash
|
@vitalybuka - any chance you could take a look at this one as well (please let me know if I'm not following process here)? I noticed no one got added as a reviewer. Thank you! |
A friendly ping here again :) |
Thanks for the approval! |
@vitalybuka - are you able to help me merge this? I notice it's approved, but I don't have commit permissions (though I'd love to gain them eventually). |
Today, the
uncaught-exception.test
fuzzer test checks for the string "libFuzzer: deadly signal" in the program output as the result of an uncaught exception.Although this is correct for
clang
,msvc
reports a different error message: "libFuzzer: uncaught C++ exception". Sincemsvc
reuses thelibFuzzer
infrastructure for ASan regression testing, it would help us greatly if the test handled themsvc
divergence more gracefully.This PR: augments this test so check for a different string (namely "libFuzzer: uncaught C++ exception") if the compiler target matches the
msvc
naming scheme.I understand if this is outside the scope of support for LLVM as well, and I'm also open for different approaches here. Thanks!