remove unwind info, add test for asmprinting of jump table labels with (%rip)
[oota-llvm.git] / test / CodeGen / X86 / lea-neg.ll
1 ; RUN: llvm-as < %s | llc -march=x86-64 > %t
2 ; RUN: grep negl %t | count 1
3 ; RUN: not grep {sub\[bwlq\]} %t
4 ; RUN: grep mov %t | count 1
5 ; RUN: grep {leal       -4(} %t | count 1
6
7 ; ISel the add of -4 with a neg and use an lea for the rest of the
8 ; arithemtic.
9
10 define i32 @test(i32 %x_offs) nounwind readnone {
11 entry:
12         %t0 = icmp sgt i32 %x_offs, 4           ; <i1> [#uses=1]
13         br i1 %t0, label %bb.nph, label %bb2
14
15 bb.nph:         ; preds = %entry
16         %tmp = add i32 %x_offs, -5              ; <i32> [#uses=1]
17         %tmp6 = lshr i32 %tmp, 2                ; <i32> [#uses=1]
18         %tmp7 = mul i32 %tmp6, -4               ; <i32> [#uses=1]
19         %tmp8 = add i32 %tmp7, %x_offs          ; <i32> [#uses=1]
20         %tmp9 = add i32 %tmp8, -4               ; <i32> [#uses=1]
21         ret i32 %tmp9
22
23 bb2:            ; preds = %entry
24         ret i32 %x_offs
25 }