1 ; RUN: opt -S -prune-eh < %s | FileCheck %s
2 ; RUN: opt -S -passes='function-attrs,function(simplify-cfg)' < %s | FileCheck %s
4 declare void @may_throw()
6 ; @callee below may be an optimized form of this function, which can
7 ; throw at runtime (see r265762 for more details):
9 ; define linkonce_odr void @callee(i32* %ptr) noinline {
11 ; %val0 = load atomic i32, i32* %ptr unordered, align 4
12 ; %val1 = load atomic i32, i32* %ptr unordered, align 4
13 ; %cmp = icmp eq i32 %val0, %val1
14 ; br i1 %cmp, label %left, label %right
20 ; call void @may_throw()
24 define linkonce_odr void @callee(i32* %ptr) noinline {
28 define i32 @caller(i32* %ptr) personality i32 3 {
29 ; CHECK-LABEL: @caller(
30 ; CHECK: invoke void @callee(i32* %ptr)
31 ; CHECK-NEXT: to label %normal unwind label %unwind
34 invoke void @callee(i32* %ptr)
35 to label %normal unwind label %unwind
41 %res = landingpad { i8*, i32 }