John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-exceptions -o - %s | FileCheck %s |
Fariborz Jahanian | f2dd68f | 2011-07-20 23:39:56 +0000 | [diff] [blame] | 2 | // pr10411 |
John McCall | 2b014d6 | 2011-10-01 10:32:24 +0000 | [diff] [blame] | 3 | // rdar://10042689 |
Fariborz Jahanian | f2dd68f | 2011-07-20 23:39:56 +0000 | [diff] [blame] | 4 | |
John McCall | 2b014d6 | 2011-10-01 10:32:24 +0000 | [diff] [blame] | 5 | id make(void); |
| 6 | void test() { |
| 7 | @throw make(); |
Fariborz Jahanian | f2dd68f | 2011-07-20 23:39:56 +0000 | [diff] [blame] | 8 | } |
| 9 | |
John McCall | 2b014d6 | 2011-10-01 10:32:24 +0000 | [diff] [blame] | 10 | // 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 |