1 ; This testcase tests to make sure a trapping instruction is hoisted when
2 ; it is guaranteed to execute.
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext "test" 2 | grep div
6 @X = global i32 0 ; <i32*> [#uses=1]
10 define i32 @test(i1 %c) {
11 %A = load i32* @X ; <i32> [#uses=2]
13 Loop: ; preds = %Loop, %0
14 ;; Should have hoisted this div!
15 %B = sdiv i32 4, %A ; <i32> [#uses=2]
16 call void @foo( i32 %B )
17 br i1 %c, label %Loop, label %Out
19 %C = sub i32 %A, %B ; <i32> [#uses=1]