xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/simplify-exceptions.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm \
2*f4a2713aSLionel Sambuc// RUN:   -fexceptions -fobjc-exceptions \
3*f4a2713aSLionel Sambuc// RUN:   -o %t %s
4*f4a2713aSLionel Sambuc// RUN: FileCheck < %t %s
5*f4a2713aSLionel Sambuc//
6*f4a2713aSLionel Sambuc// <rdar://problem/7471679> [irgen] [eh] Exception code built with clang (x86_64) crashes
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc// Check that we don't emit unnecessary personality function references.
9*f4a2713aSLionel Sambucstruct t0_A { t0_A(); };
10*f4a2713aSLionel Sambucstruct t0_B { t0_A a; };
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc// CHECK: define {{.*}} @_Z2t0v(){{.*}} {
13*f4a2713aSLionel Sambuc// CHECK-NOT: objc_personality
14*f4a2713aSLionel Sambuc// CHECK: }
15*f4a2713aSLionel Sambuct0_B& t0() {
16*f4a2713aSLionel Sambuc static t0_B x;
17*f4a2713aSLionel Sambuc return x;
18*f4a2713aSLionel Sambuc}
19