Anders Carlsson | e9b801f | 2011-02-22 01:52:06 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fgnu-runtime -o - %s | FileCheck %s |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 2 | |
| 3 | void opaque(void); |
| 4 | void log(int i); |
| 5 | |
| 6 | @class C; |
| 7 | |
| 8 | // CHECK: define void @test0() { |
| 9 | void test0() { |
| 10 | @try { |
| 11 | // CHECK: invoke void @opaque() |
| 12 | opaque(); |
John McCall | ff8e115 | 2010-07-23 21:56:41 +0000 | [diff] [blame] | 13 | |
| 14 | // CHECK: call void @log(i32 1) |
| 15 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 16 | } @catch (C *c) { |
| 17 | // CHECK: call i8* @llvm.eh.exception() |
| 18 | // CHECK: call i32 (i8*, i8*, ...)* @llvm.eh.selector({{.*}} @__gnu_objc_personality_v0 |
| 19 | // CHECK: br i1 |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 20 | |
| 21 | // CHECK: call void @log(i32 0) |
John McCall | ff8e115 | 2010-07-23 21:56:41 +0000 | [diff] [blame] | 22 | |
| 23 | // CHECK: call void @objc_exception_throw |
| 24 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 25 | log(0); |
| 26 | } |
| 27 | |
John McCall | 8262b6a | 2010-07-17 00:43:08 +0000 | [diff] [blame] | 28 | log(1); |
| 29 | } |