Skip to content

Commit 808ce4b

Browse files
authored
Augment uncaught-exception.test fuzzer test to be msvc-compatible
1 parent 113534d commit 808ce4b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler-rt/test/fuzzer/uncaught-exception.test

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
REQUIRES: windows
55
RUN: %cpp_compiler %S/UncaughtException.cpp -o %t-UncaughtException
66

7-
RUN: not %run %t-UncaughtException 2>&1 | FileCheck %s
7+
# Clang will fail the test with 'deadly signal', but other compilers may fail with different error messages.
8+
# For example, msvc fails with 'uncaught C++ exception'. So the error we check depends on the compiler target.
9+
RUN: not %run %t-UncaughtException 2>&1 | FileCheck %s --check-prefixes=CHECK-CRASH,%if target={{.*-windows-msvc.*}} %{CHECK-MSVC%} %else %{CHECK-ERROR%}
810

9-
CHECK: ERROR: libFuzzer: deadly signal
10-
CHECK: Test unit written to ./crash
11+
CHECK-ERROR: ERROR: libFuzzer: deadly signal
12+
CHECK-MSVC: ERROR: libFuzzer: uncaught C++ exception
13+
CHECK-CRASH: Test unit written to ./crash

0 commit comments

Comments
 (0)