blob: 213b05bffded777a52f75e3f8f950a6801dc6e3c [file] [log] [blame]
John McCalld1e40d52011-10-02 01:16:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-exceptions -o - %s | FileCheck %s
Fariborz Jahanianf2dd68f2011-07-20 23:39:56 +00002// pr10411
John McCall2b014d62011-10-01 10:32:24 +00003// rdar://10042689
Fariborz Jahanianf2dd68f2011-07-20 23:39:56 +00004
John McCall2b014d62011-10-01 10:32:24 +00005id make(void);
6void test() {
7 @throw make();
Fariborz Jahanianf2dd68f2011-07-20 23:39:56 +00008}
9
John McCall2b014d62011-10-01 10:32:24 +000010// TODO: We should probably emit this specific pattern without the reclaim.
11
12// CHECK: define void @test()
13// CHECK: [[T0:%.*]] = call i8* @make()
14// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
15// CHECK-NEXT: [[T2:%.*]] = call i8* @objc_autorelease(i8* [[T1]])
16// CHECK-NEXT: call void @objc_exception_throw(i8* [[T2]]) noreturn
17// CHECK-NEXT: unreachable