blob: 7f3ae9df467e2264cac0e188cbab7172b44d18fb [file] [log] [blame]
Anders Carlssone9b801f2011-02-22 01:52:06 +00001// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fgnu-runtime -o - %s | FileCheck %s
John McCall8262b6a2010-07-17 00:43:08 +00002
3void opaque(void);
4void log(int i);
5
6@class C;
7
8// CHECK: define void @test0() {
9void test0() {
10 @try {
11 // CHECK: invoke void @opaque()
12 opaque();
John McCallff8e1152010-07-23 21:56:41 +000013
14 // CHECK: call void @log(i32 1)
15
John McCall8262b6a2010-07-17 00:43:08 +000016 } @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 McCall8262b6a2010-07-17 00:43:08 +000020
21 // CHECK: call void @log(i32 0)
John McCallff8e1152010-07-23 21:56:41 +000022
23 // CHECK: call void @objc_exception_throw
24
John McCall8262b6a2010-07-17 00:43:08 +000025 log(0);
26 }
27
John McCall8262b6a2010-07-17 00:43:08 +000028 log(1);
29}