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