Files
clang-p2996/clang/test/CodeGenObjC/arc-exceptions.m
Aaron Ballman d618f1c3b1 Remove rdar links; NFC
This removes links to rdar, which is an internal bug tracker that the
community doesn't have visibility into.

See further discussion at:
https://discourse.llvm.org/t/code-review-reminder-about-links-in-code-commit-messages/71847
2023-07-07 08:41:11 -04:00

39 lines
1.3 KiB
Objective-C

// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime-has-weak -o - %s | FileCheck %s
@class Ety;
// These first two tests are all PR11732
void test0_helper(void);
void test0(void) {
@try {
test0_helper();
} @catch (Ety *e) {
}
}
// CHECK-LABEL: define{{.*}} void @test0()
// CHECK: [[E:%e]] = alloca ptr, align 8
// CHECK: invoke void @test0_helper()
// CHECK: [[T0:%.*]] = call ptr @objc_begin_catch(
// CHECK-NEXT: [[T3:%.*]] = call ptr @llvm.objc.retain(ptr [[T0]]) [[NUW:#[0-9]+]]
// CHECK-NEXT: store ptr [[T3]], ptr [[E]]
// CHECK-NEXT: call void @llvm.objc.storeStrong(ptr [[E]], ptr null) [[NUW]]
// CHECK-NEXT: call void @objc_end_catch() [[NUW]]
void test1_helper(void);
void test1(void) {
@try {
test1_helper();
} @catch (__weak Ety *e) {
}
}
// CHECK-LABEL: define{{.*}} void @test1()
// CHECK: [[E:%e]] = alloca ptr, align 8
// CHECK: invoke void @test1_helper()
// CHECK: [[T0:%.*]] = call ptr @objc_begin_catch(
// CHECK-NEXT: call ptr @llvm.objc.initWeak(ptr [[E]], ptr [[T0]]) [[NUW]]
// CHECK-NEXT: call void @llvm.objc.destroyWeak(ptr [[E]]) [[NUW]]
// CHECK-NEXT: call void @objc_end_catch() [[NUW]]
// CHECK: attributes [[NUW]] = { nounwind }