blob: e5295159ce5e95f36b8af1329ec0f4eae072cfcf [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
Stephen Lin93ab6bf2013-08-15 06:47:53 +000012// CHECK-LABEL: define void @test()
John McCall2b014d62011-10-01 10:32:24 +000013// 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]])
Bill Wendling4e1125f2013-02-22 09:10:20 +000016// CHECK-NEXT: call void @objc_exception_throw(i8* [[T2]]) [[NR:#[0-9]+]]
John McCall2b014d62011-10-01 10:32:24 +000017// CHECK-NEXT: unreachable
Bill Wendling4e1125f2013-02-22 09:10:20 +000018
19// CHECK: attributes [[NR]] = { noreturn }