Model stacksave and stackrestore as both writing memory, since we
[oota-llvm.git] / test / Transforms / InstCombine / sink_instruction.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
2 ; RUN:   %prcontext div 1 | grep ret
3
4 ;; This tests that the instructions in the entry blocks are sunk into each
5 ;; arm of the 'if'.
6
7 int %foo(bool %C, int %A, int %B) {
8 entry:
9         %tmp.2 = div int %A, %B
10         %tmp.9 = add int %B, %A
11         br bool %C, label %then, label %endif
12
13 then:
14         ret int %tmp.9
15
16 endif:
17         ret int %tmp.2
18 }