1 ; RUN: llvm-as < %s | llc -code-model=small | FileCheck -check-prefix CHECK-SMALL %s
2 ; RUN: llvm-as < %s | llc -code-model=kernel | FileCheck -check-prefix CHECK-KERNEL %s
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
5 target triple = "x86_64-unknown-linux-gnu"
6 @data = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
8 define i32 @foo() nounwind readonly {
11 ; CHECK-SMALL: movl data, %eax
13 ; CHECK-KERNEL: movl data, %eax
14 %0 = load i32* getelementptr ([0 x i32]* @data, i64 0, i64 0), align 4 ; <i32> [#uses=1]
18 define i32 @foo2() nounwind readonly {
21 ; CHECK-SMALL: movl data+40, %eax
23 ; CHECK-KERNEL: movl data+40, %eax
24 %0 = load i32* getelementptr ([0 x i32]* @data, i32 0, i64 10), align 4 ; <i32> [#uses=1]
28 define i32 @foo3() nounwind readonly {
31 ; CHECK-SMALL: movl data-40, %eax
33 ; CHECK-KERNEL: movq $-40, %rax
34 %0 = load i32* getelementptr ([0 x i32]* @data, i32 0, i64 -10), align 4 ; <i32> [#uses=1]
38 define i32 @foo4() nounwind readonly {
40 ; FIXME: We really can use movabsl here!
42 ; CHECK-SMALL: movl $16777216, %eax
43 ; CHECK-SMALL: movl data(%rax), %eax
45 ; CHECK-KERNEL: movl data+16777216, %eax
46 %0 = load i32* getelementptr ([0 x i32]* @data, i32 0, i64 4194304), align 4 ; <i32> [#uses=1]
50 define i32 @foo1() nounwind readonly {
53 ; CHECK-SMALL: movl data+16777212, %eax
55 ; CHECK-KERNEL: movl data+16777212, %eax
56 %0 = load i32* getelementptr ([0 x i32]* @data, i32 0, i64 4194303), align 4 ; <i32> [#uses=1]
59 define i32 @foo5() nounwind readonly {
62 ; CHECK-SMALL: movl data-16777216, %eax
64 ; CHECK-KERNEL: movq $-16777216, %rax
65 %0 = load i32* getelementptr ([0 x i32]* @data, i32 0, i64 -4194304), align 4 ; <i32> [#uses=1]