2012-07-04 04:49:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gcc -o - %s | FileCheck %s
|
2013-01-11 23:33:01 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gnustep-1.7 -o - %s | FileCheck -check-prefix=NEW-ABI %s
|
2010-07-17 08:43:08 +08:00
|
|
|
|
|
|
|
void opaque(void);
|
|
|
|
void log(int i);
|
|
|
|
|
|
|
|
@class C;
|
|
|
|
|
2015-06-18 04:53:19 +08:00
|
|
|
// CHECK: define void @test0() [[TF:#[0-9]+]]
|
|
|
|
// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*)
|
2010-07-17 08:43:08 +08:00
|
|
|
void test0() {
|
|
|
|
@try {
|
|
|
|
// CHECK: invoke void @opaque()
|
|
|
|
opaque();
|
2010-07-24 05:56:41 +08:00
|
|
|
|
|
|
|
// CHECK: call void @log(i32 1)
|
|
|
|
|
2010-07-17 08:43:08 +08:00
|
|
|
} @catch (C *c) {
|
2015-06-18 04:53:19 +08:00
|
|
|
// CHECK: landingpad { i8*, i32 }
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0)
|
2011-09-20 04:31:14 +08:00
|
|
|
// CHECK: br i1
|
2010-07-17 08:43:08 +08:00
|
|
|
|
|
|
|
// CHECK: call void @log(i32 0)
|
2010-07-24 05:56:41 +08:00
|
|
|
|
2012-11-08 00:50:40 +08:00
|
|
|
// CHECK: resume
|
2013-01-11 23:33:01 +08:00
|
|
|
// NEW-ABI: objc_begin_catch
|
|
|
|
// NEW-ABI: objc_end_catch
|
2010-07-24 05:56:41 +08:00
|
|
|
|
2010-07-17 08:43:08 +08:00
|
|
|
log(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
log(1);
|
|
|
|
}
|
2013-03-01 06:49:57 +08:00
|
|
|
|
2017-05-29 13:38:20 +08:00
|
|
|
// CHECK: attributes [[TF]] = { noinline optnone "{{.*}} }
|