blob: c5e9dc92beb8de55f4281bc1b3ef7c36be8ca470 [file] [log] [blame]
John McCall9b0a7ce2011-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 Jahanian517695b2011-07-20 23:39:56 +00002// pr10411
John McCall248512a2011-10-01 10:32:24 +00003// rdar://10042689
Fariborz Jahanian517695b2011-07-20 23:39:56 +00004
John McCall248512a2011-10-01 10:32:24 +00005id make(void);
6void test() {
7 @throw make();
Fariborz Jahanian517695b2011-07-20 23:39:56 +00008}
9
John McCall248512a2011-10-01 10:32:24 +000010// TODO: We should probably emit this specific pattern without the reclaim.
11
Stephen Lin43622612013-08-15 06:47:53 +000012// CHECK-LABEL: define void @test()
John McCall248512a2011-10-01 10:32:24 +000013// CHECK: [[T0:%.*]] = call i8* @make()
Akira Hatanaka65bb3f92019-03-21 19:59:49 +000014// CHECK-NEXT: [[T1:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
Pete Cooper2cd35962018-12-18 20:33:00 +000015// CHECK-NEXT: [[T2:%.*]] = call i8* @llvm.objc.autorelease(i8* [[T1]])
Bill Wendlinge1c4a1b2013-02-22 09:10:20 +000016// CHECK-NEXT: call void @objc_exception_throw(i8* [[T2]]) [[NR:#[0-9]+]]
John McCall248512a2011-10-01 10:32:24 +000017// CHECK-NEXT: unreachable
Bill Wendlinge1c4a1b2013-02-22 09:10:20 +000018
19// CHECK: attributes [[NR]] = { noreturn }