Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / LICM / 2003-08-04-TrappingInstOkHoist.ll
1 ; This testcase tests to make sure a trapping instruction is hoisted when
2 ; it is guaranteed to execute.
3 ;
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | %prcontext "test" 2 | grep div
5
6 %X = global int 0
7 declare void %foo(int)
8
9 int %test(bool %c) {
10         %A = load int *%X
11         br label %Loop
12 Loop:
13         %B = div int 4, %A  ;; Should have hoisted this div!
14         call void %foo(int %B)
15         br bool %c, label %Loop, label %Out
16
17 Out:
18         %C = sub int %A, %B
19         ret int %C
20 }