19 lines · cpp
1// clang-format off2// XFAIL for arm, or running on Windows.3// XFAIL: target=arm-{{.*}}, target=armv{{.*}}, system-windows, system-cygwin4// RUN: cat %s | clang-repl | FileCheck %s5 6// Incompatible with msan. It passes with -O3 but fail -Oz. Interpreter7// generates non-instrumented code, which may call back to instrumented.8// UNSUPPORTED: msan9 10extern "C" int printf(const char *, ...);11 12int f() { throw "Simple exception"; return 0; }13int checkException() { try { printf("Running f()\n"); f(); } catch (const char *e) { printf("%s\n", e); } return 0; }14auto r1 = checkException();15// CHECK: Running f()16// CHECK-NEXT: Simple exception17 18%quit19