1 ; This example was not getting level raised because of a negative index from
3 ; %reg111 = add int %reg110, -12
4 ; this testcase is distilled from this C source:
5 ; void foo(int j, int *x) {
7 ; for (i = 12; i < 14; ++i)
11 ; RUN: llvm-as < %s | opt -raise | llvm-dis | grep ' cast ' | not grep '*'
15 void "foo"(int %j, int * %x)
21 %reg108 = cast int * %x to sbyte * ; <sbyte *> [#uses=1]
22 %cond219 = setgt ulong 12, 13 ; <bool> [#uses=1]
23 br bool %cond219, label %bb3, label %bb2
26 %cann-indvar = phi uint [ 0, %bb1 ], [ %add1-indvar, %bb2 ] ; <uint> [#uses=2]
27 %reg117 = add uint %cann-indvar, 12 ; <uint> [#uses=2]
28 %add1-indvar = add uint %cann-indvar, 1 ; <uint> [#uses=1]
29 %cast224 = cast uint %reg117 to uint ; <uint> [#uses=1]
30 %cast225 = cast uint %reg117 to int ; <int> [#uses=1]
31 %reg110 = mul int %j, %cast225 ; <int> [#uses=1]
32 %reg111 = add int %reg110, -12 ; <int> [#uses=1]
33 %cast222 = cast int %reg111 to uint ; <uint> [#uses=1]
34 %reg113 = shl uint %cast222, ubyte 2 ; <uint> [#uses=1]
35 %cast114 = cast uint %reg113 to ulong ; <ulong> [#uses=1]
36 %cast115 = cast ulong %cast114 to sbyte * ; <sbyte *> [#uses=1]
37 %reg116 = add sbyte * %reg108, %cast115 ; <sbyte *> [#uses=1]
38 %cast223 = cast sbyte * %reg116 to int * ; <int *> [#uses=1]
39 store int %j, int * %cast223
40 %reg118 = add uint %cast224, 1 ; <uint> [#uses=1]
41 %cond220 = setle uint %reg118, 13 ; <bool> [#uses=1]
42 br bool %cond220, label %bb2, label %bb3