xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/PR5863-unreachable-block.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -emit-llvm-only %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc // PR5863
4f4a2713aSLionel Sambuc class E { };
5f4a2713aSLionel Sambuc 
P1()6f4a2713aSLionel Sambuc void P1() {
7f4a2713aSLionel Sambuc  try {
8f4a2713aSLionel Sambuc   int a=0, b=0;
9f4a2713aSLionel Sambuc   if (a > b) // simply filling in 0 or 1 doesn't trigger the assertion
10f4a2713aSLionel Sambuc     throw E(); // commenting out 'if' or 'throw' 'fixes' the assertion failure
11f4a2713aSLionel Sambuc   try { } catch (...) { } // empty try/catch block needed for failure
12f4a2713aSLionel Sambuc  } catch (...) { } // this try/catch block needed for failure
13f4a2713aSLionel Sambuc }
14