Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
[oota-llvm.git] / test / Transforms / LICM / 2003-12-13-VolatilePromote.ll
1 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext volatile 1 | grep Loop
2
3 @X = global i32 7               ; <i32*> [#uses=2]
4
5 define void @testfunc(i32 %i) {
6         br label %Loop
7 Loop:           ; preds = %Loop, %0
8         ; Should not promote this to a register
9         %x = volatile load i32* @X              ; <i32> [#uses=1]
10         %x2 = add i32 %x, 1             ; <i32> [#uses=1]
11         store i32 %x2, i32* @X
12         br i1 true, label %Out, label %Loop
13 Out:            ; preds = %Loop
14         ret void
15 }
16