David Chisnall | 11d3f4c | 2012-07-03 20:49:52 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fobjc-runtime=gcc -o - %s | FileCheck %s |
David Chisnall | 65bd4ac | 2013-01-11 15:33:01 +0000 | [diff] [blame] | 2 | // 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 |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 3 | |
| 4 | void opaque(void); |
| 5 | void log(int i); |
| 6 | |
| 7 | @class C; |
| 8 | |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 9 | // CHECK: define void @test0() [[TF:#[0-9]+]] { |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 10 | void test0() { |
| 11 | @try { |
| 12 | // CHECK: invoke void @opaque() |
| 13 | opaque(); |
John McCall | ff8e115 | 2010-07-23 21:56:41 +0000 | [diff] [blame] | 14 | |
| 15 | // CHECK: call void @log(i32 1) |
| 16 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 17 | } @catch (C *c) { |
Bill Wendling | 285cfd8 | 2011-09-19 20:31:14 +0000 | [diff] [blame] | 18 | // CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) |
| 19 | // CHECK-NEXT: catch i8* getelementptr inbounds ([2 x i8]* @0, i64 0, i64 0) |
| 20 | // CHECK: br i1 |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 21 | |
| 22 | // CHECK: call void @log(i32 0) |
John McCall | ff8e115 | 2010-07-23 21:56:41 +0000 | [diff] [blame] | 23 | |
David Chisnall | c686004 | 2012-11-07 16:50:40 +0000 | [diff] [blame] | 24 | // CHECK: resume |
David Chisnall | 65bd4ac | 2013-01-11 15:33:01 +0000 | [diff] [blame] | 25 | // NEW-ABI: objc_begin_catch |
| 26 | // NEW-ABI: objc_end_catch |
John McCall | ff8e115 | 2010-07-23 21:56:41 +0000 | [diff] [blame] | 27 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 28 | log(0); |
| 29 | } |
| 30 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 31 | log(1); |
| 32 | } |
Bill Wendling | be9e8bf | 2013-02-28 22:49:57 +0000 | [diff] [blame] | 33 | |
| 34 | // CHECK: attributes [[TF]] = { "{{.*}} } |