xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/x86-64-mem.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: llc < %s -mtriple=x86_64-apple-darwin -o %t1
2*f4a2713aSLionel Sambuc; RUN: grep GOTPCREL %t1 | count 4
3*f4a2713aSLionel Sambuc; RUN: grep %%rip      %t1 | count 6
4*f4a2713aSLionel Sambuc; RUN: grep movq     %t1 | count 6
5*f4a2713aSLionel Sambuc; RUN: grep leaq     %t1 | count 1
6*f4a2713aSLionel Sambuc; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=static -o %t2
7*f4a2713aSLionel Sambuc; RUN: grep movl %t2 | count 2
8*f4a2713aSLionel Sambuc; RUN: grep movq %t2 | count 2
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@ptr = external global i32*		; <i32**> [#uses=1]
11*f4a2713aSLionel Sambuc@src = external global [0 x i32]		; <[0 x i32]*> [#uses=1]
12*f4a2713aSLionel Sambuc@dst = external global [0 x i32]		; <[0 x i32]*> [#uses=1]
13*f4a2713aSLionel Sambuc@lptr = internal global i32* null		; <i32**> [#uses=1]
14*f4a2713aSLionel Sambuc@ldst = internal global [500 x i32] zeroinitializer, align 32		; <[500 x i32]*> [#uses=1]
15*f4a2713aSLionel Sambuc@lsrc = internal global [500 x i32] zeroinitializer, align 32		; <[500 x i32]*> [#uses=0]
16*f4a2713aSLionel Sambuc@bsrc = internal global [500000 x i32] zeroinitializer, align 32		; <[500000 x i32]*> [#uses=0]
17*f4a2713aSLionel Sambuc@bdst = internal global [500000 x i32] zeroinitializer, align 32		; <[500000 x i32]*> [#uses=0]
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambucdefine void @test1() nounwind {
20*f4a2713aSLionel Sambuc	%tmp = load i32* getelementptr ([0 x i32]* @src, i32 0, i32 0)		; <i32> [#uses=1]
21*f4a2713aSLionel Sambuc	store i32 %tmp, i32* getelementptr ([0 x i32]* @dst, i32 0, i32 0)
22*f4a2713aSLionel Sambuc	ret void
23*f4a2713aSLionel Sambuc}
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambucdefine void @test2() nounwind {
26*f4a2713aSLionel Sambuc	store i32* getelementptr ([0 x i32]* @dst, i32 0, i32 0), i32** @ptr
27*f4a2713aSLionel Sambuc	ret void
28*f4a2713aSLionel Sambuc}
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambucdefine void @test3() nounwind {
31*f4a2713aSLionel Sambuc	store i32* getelementptr ([500 x i32]* @ldst, i32 0, i32 0), i32** @lptr
32*f4a2713aSLionel Sambuc	br label %return
33*f4a2713aSLionel Sambuc
34*f4a2713aSLionel Sambucreturn:		; preds = %0
35*f4a2713aSLionel Sambuc	ret void
36*f4a2713aSLionel Sambuc}
37