llvm.org GIT mirror llvm / a5cb564
Add X86-64 load / store codegen tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32047 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
1 changed file(s) with 36 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc -march=x86-64 &&
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep GOTPCREL | wc -l | grep 4 &&
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep rip | wc -l | grep 6 &&
3 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movq | wc -l | grep 6 &&
4 ; RUN: llvm-as < %s | llc -march=x86-64 | grep leaq | wc -l | grep 1 &&
5 ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep rip | wc -l | grep 4 &&
6 ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep movl | wc -l | grep 2 &&
7 ; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep movq | wc -l | grep 2
8
9 %ptr = external global int*
10 %src = external global [0 x int]
11 %dst = external global [0 x int]
12 %lptr = internal global int* null
13 %ldst = internal global [500 x int] zeroinitializer, align 32
14 %lsrc = internal global [500 x int] zeroinitializer, align 32
15 %bsrc = internal global [500000 x int] zeroinitializer, align 32
16 %bdst = internal global [500000 x int] zeroinitializer, align 32
17
18 void %test1() {
19 %tmp = load int* getelementptr ([0 x int]* %src, int 0, int 0)
20 store int %tmp, int* getelementptr ([0 x int]* %dst, int 0, int 0)
21 ret void
22 }
23
24 void %test2() {
25 store int* getelementptr ([0 x int]* %dst, int 0, int 0), int** %ptr
26 ret void
27 }
28
29 void %test3() {
30 store int* getelementptr ([500 x int]* %ldst, int 0, int 0), int** %lptr
31 br label %return
32
33 return:
34 ret void
35 }