llvm.org GIT mirror llvm / 2b5d75c
new testcase for x86 backend miscompilation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33883 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc -march=x86 | grep 'orl $1, %eax' &&
1 ; RUN: llvm-as < %s | llc -march=x86 | grep 'leal 3(,%eax,8)'
2
3 ;; This example can't fold the or into an LEA.
4 define i32 @test(float ** %tmp2, i32 %tmp12) {
5 %tmp3 = load float** %tmp2
6 %tmp132 = shl i32 %tmp12, 2 ; [#uses=1]
7 %tmp3 = bitcast float* %tmp3 to i8* ; [#uses=1]
8 %ctg2 = getelementptr i8* %tmp3, i32 %tmp132 ; [#uses=1]
9 %tmp6 = ptrtoint i8* %ctg2 to i32 ; [#uses=1]
10 %tmp14 = or i32 %tmp6, 1 ; [#uses=1]
11 ret i32 %tmp14
12 }
13
14
15 ;; This can!
16 define i32 @test2(i32 %a, i32 %b) {
17 %c = shl i32 %a, 3
18 %d = or i32 %c, 3
19 ret i32 %d
20 }