[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT
[llvm-core.git] / test / Transforms / PruneEH / ipo-nounwind.ll
blobba3fab1c0dd56e84828931cc5d486edd79974c0e
1 ; RUN: opt -S -prune-eh < %s | FileCheck %s
3 declare void @may_throw()
5 ; @callee below may be an optimized form of this function, which can
6 ; throw at runtime (see r265762 for more details):
7
8 ; define linkonce_odr void @callee(i32* %ptr) noinline {
9 ; entry:
10 ;   %val0 = load atomic i32, i32* %ptr unordered, align 4
11 ;   %val1 = load atomic i32, i32* %ptr unordered, align 4
12 ;   %cmp = icmp eq i32 %val0, %val1
13 ;   br i1 %cmp, label %left, label %right
15 ; left:
16 ;   ret void
18 ; right:
19 ;   call void @may_throw()
20 ;   ret void
21 ; }
23 define linkonce_odr void @callee(i32* %ptr) noinline {
24   ret void
27 define i32 @caller(i32* %ptr) personality i32 3 {
28 ; CHECK-LABEL: @caller(
29 ; CHECK:  invoke void @callee(i32* %ptr)
30 ; CHECK-NEXT:          to label %normal unwind label %unwind
32 entry:
33   invoke void @callee(i32* %ptr)
34           to label %normal unwind label %unwind
36 normal:
37   ret i32 1
39 unwind:
40   %res = landingpad { i8*, i32 }
41          cleanup
42   ret i32 2