• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -fexceptions -fobjc-exceptions -fgnu-runtime -o - %s | FileCheck %s
2
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();
13
14    // CHECK: call void @log(i32 1)
15
16  } @catch (C *c) {
17    // CHECK:      landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*)
18    // CHECK-NEXT:   catch i8* getelementptr inbounds ([2 x i8]* @0, i64 0, i64 0)
19    // CHECK:      br i1
20
21    // CHECK: call void @log(i32 0)
22
23    // CHECK: call void @objc_exception_throw
24
25    log(0);
26  }
27
28  log(1);
29}
30