xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/arc-with-atthrow.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-exceptions -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc// pr10411
3*f4a2713aSLionel Sambuc// rdar://10042689
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucid make(void);
6*f4a2713aSLionel Sambucvoid test() {
7*f4a2713aSLionel Sambuc  @throw make();
8*f4a2713aSLionel Sambuc}
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc// TODO: We should probably emit this specific pattern without the reclaim.
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc// CHECK-LABEL:    define void @test()
13*f4a2713aSLionel Sambuc// CHECK:      [[T0:%.*]] = call i8* @make()
14*f4a2713aSLionel Sambuc// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
15*f4a2713aSLionel Sambuc// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_autorelease(i8* [[T1]])
16*f4a2713aSLionel Sambuc// CHECK-NEXT: call void @objc_exception_throw(i8* [[T2]]) [[NR:#[0-9]+]]
17*f4a2713aSLionel Sambuc// CHECK-NEXT: unreachable
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc// CHECK: attributes [[NR]] = { noreturn }
20