1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc --relocation-model=static -code-model=small < %s | FileCheck %s
3 ; RUN: llc --relocation-model=static -code-model=medium < %s | FileCheck %s
4 ; RUN: llc --relocation-model=static -code-model=large < %s | FileCheck %s --check-prefix=LARGE
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
9 @global = external dso_local global i32
10 declare dso_local void @func()
12 define ptr @global_addr() #0 {
13 ; CHECK-LABEL: global_addr:
15 ; CHECK-NEXT: movq global@GOTPCREL_NORELAX(%rip), %rax
18 ; LARGE-LABEL: global_addr:
20 ; LARGE-NEXT: movabsq $global, %rax
25 define i32 @global_load() #0 {
26 ; CHECK-LABEL: global_load:
28 ; CHECK-NEXT: movq global@GOTPCREL_NORELAX(%rip), %rax
29 ; CHECK-NEXT: movl (%rax), %eax
32 ; LARGE-LABEL: global_load:
34 ; LARGE-NEXT: movabsq $global, %rax
35 ; LARGE-NEXT: movl (%rax), %eax
37 %load = load i32, ptr @global
41 define void @global_store() #0 {
42 ; CHECK-LABEL: global_store:
44 ; CHECK-NEXT: movq global@GOTPCREL_NORELAX(%rip), %rax
45 ; CHECK-NEXT: movl $0, (%rax)
48 ; LARGE-LABEL: global_store:
50 ; LARGE-NEXT: movabsq $global, %rax
51 ; LARGE-NEXT: movl $0, (%rax)
53 store i32 0, ptr @global
57 define ptr @func_addr() #0 {
58 ; CHECK-LABEL: func_addr:
60 ; CHECK-NEXT: movl $func, %eax
63 ; LARGE-LABEL: func_addr:
65 ; LARGE-NEXT: movabsq $func, %rax
70 attributes #0 = { "target-features"="+tagged-globals" }