1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/Transforms/PruneEH/ipo-nounwind.ll
Sanjoy Das b4ec359753 [PruneEH] Be correct in the face IPO
This fixes one spot I had missed in r265762.  Credit goes to Philip
Reames for spotting this one!

llvm-svn: 283137
2016-10-03 19:35:30 +00:00

44 lines
960 B
LLVM

; RUN: opt -S -prune-eh < %s | FileCheck %s
declare void @may_throw()
; @callee below may be an optimized form of this function, which can
; throw at runtime (see r265762 for more details):
;
; define linkonce_odr void @callee(i32* %ptr) noinline {
; entry:
; %val0 = load atomic i32, i32* %ptr unordered, align 4
; %val1 = load atomic i32, i32* %ptr unordered, align 4
; %cmp = icmp eq i32 %val0, %val1
; br i1 %cmp, label %left, label %right
; left:
; ret void
; right:
; call void @may_throw()
; ret void
; }
define linkonce_odr void @callee(i32* %ptr) noinline {
ret void
}
define i32 @caller(i32* %ptr) personality i32 3 {
; CHECK-LABEL: @caller(
; CHECK: invoke void @callee(i32* %ptr)
; CHECK-NEXT: to label %normal unwind label %unwind
entry:
invoke void @callee(i32* %ptr)
to label %normal unwind label %unwind
normal:
ret i32 1
unwind:
%res = landingpad { i8*, i32 }
cleanup
ret i32 2
}