xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/try-catch.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc struct X { };
4f4a2713aSLionel Sambuc 
5f4a2713aSLionel Sambuc const X g();
6f4a2713aSLionel Sambuc 
f()7f4a2713aSLionel Sambuc void f() {
8f4a2713aSLionel Sambuc   try {
9f4a2713aSLionel Sambuc     throw g();
10f4a2713aSLionel Sambuc     // CHECK: @_ZTI1X to i8
11f4a2713aSLionel Sambuc   } catch (const X x) {
12f4a2713aSLionel Sambuc   }
13f4a2713aSLionel Sambuc }
14*0a6a1f1dSLionel Sambuc 
h()15*0a6a1f1dSLionel Sambuc void h() {
16*0a6a1f1dSLionel Sambuc   try {
17*0a6a1f1dSLionel Sambuc     throw "ABC";
18*0a6a1f1dSLionel Sambuc     // CHECK: @_ZTIPKc to i8
19*0a6a1f1dSLionel Sambuc   } catch (char const(&)[4]) {
20*0a6a1f1dSLionel Sambuc   }
21*0a6a1f1dSLionel Sambuc }
22