1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime-has-weak -o - %s | FileCheck %s
5 // These first two tests are all PR11732
7 void test0_helper(void);
14 // CHECK-LABEL: define{{.*}} void @test0()
15 // CHECK: [[E:%e]] = alloca ptr, align 8
16 // CHECK: invoke void @test0_helper()
17 // CHECK: [[T0:%.*]] = call ptr @objc_begin_catch(
18 // CHECK-NEXT: [[T3:%.*]] = call ptr @llvm.objc.retain(ptr [[T0]]) [[NUW:#[0-9]+]]
19 // CHECK-NEXT: store ptr [[T3]], ptr [[E]]
20 // CHECK-NEXT: call void @llvm.objc.storeStrong(ptr [[E]], ptr null) [[NUW]]
21 // CHECK-NEXT: call void @objc_end_catch() [[NUW]]
23 void test1_helper(void);
27 } @catch (__weak Ety *e) {
30 // CHECK-LABEL: define{{.*}} void @test1()
31 // CHECK: [[E:%e]] = alloca ptr, align 8
32 // CHECK: invoke void @test1_helper()
33 // CHECK: [[T0:%.*]] = call ptr @objc_begin_catch(
34 // CHECK-NEXT: call ptr @llvm.objc.initWeak(ptr [[E]], ptr [[T0]]) [[NUW]]
35 // CHECK-NEXT: call void @llvm.objc.destroyWeak(ptr [[E]]) [[NUW]]
36 // CHECK-NEXT: call void @objc_end_catch() [[NUW]]
38 // CHECK: attributes [[NUW]] = { nounwind }