diff --git a/compiler-rt/test/fuzzer/uncaught-exception.test b/compiler-rt/test/fuzzer/uncaught-exception.test index b055c88f6d903..d1b98cfb7c74b 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