2012-08-15 20:02:54 +00:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gcc -o - %s | FileCheck %s
|
2013-04-08 18:45:10 +00: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-09-17 15:54:40 +00:00
|
|
|
|
|
|
|
void opaque(void);
|
|
|
|
void log(int i);
|
|
|
|
|
|
|
|
@class C;
|
|
|
|
|
2015-06-21 14:00:56 +00:00
|
|
|
// CHECK: define void @test0() [[TF:#[0-9]+]]
|
|
|
|
// CHECK-SAME: personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*)
|
2010-09-17 15:54:40 +00:00
|
|
|
void test0() {
|
|
|
|
@try {
|
|
|
|
// CHECK: invoke void @opaque()
|
|
|
|
opaque();
|
|
|
|
|
|
|
|
// CHECK: call void @log(i32 1)
|
|
|
|
|
|
|
|
} @catch (C *c) {
|
2015-06-21 14:00:56 +00:00
|
|
|
// CHECK: landingpad { i8*, i32 }
|
2015-05-27 18:47:56 +00:00
|
|
|
// CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i64 0, i64 0)
|
2011-10-20 21:14:49 +00:00
|
|
|
// CHECK: br i1
|
2010-09-17 15:54:40 +00:00
|
|
|
|
|
|
|
// CHECK: call void @log(i32 0)
|
|
|
|
|
2012-12-02 13:20:44 +00:00
|
|
|
// CHECK: resume
|
2013-04-08 18:45:10 +00:00
|
|
|
// NEW-ABI: objc_begin_catch
|
|
|
|
// NEW-ABI: objc_end_catch
|
2010-09-17 15:54:40 +00:00
|
|
|
|
|
|
|
log(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
log(1);
|
|
|
|
}
|
2013-04-08 18:45:10 +00:00
|
|
|
|
|
|
|
// CHECK: attributes [[TF]] = { "{{.*}} }
|