1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
3 ; RUN: llc -mtriple=x86_64-apple-darwin -global-isel -verify-machineinstrs -relocation-model=pic < %s -o - | FileCheck %s --check-prefix=X64_DARWIN_PIC
4 ; RUN: llc -mtriple=i386-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32
5 ; RUN: llc -mtriple=x86_64-linux-gnux32 -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32ABI
7 @g_int = global i32 0, align 4
9 ; Function Attrs: noinline nounwind optnone uwtable
10 define i32* @test_global_ptrv() #3 {
11 ; X64-LABEL: test_global_ptrv:
12 ; X64: # %bb.0: # %entry
13 ; X64-NEXT: leaq g_int, %rax
16 ; X64_DARWIN_PIC-LABEL: test_global_ptrv:
17 ; X64_DARWIN_PIC: ## %bb.0: ## %entry
18 ; X64_DARWIN_PIC-NEXT: leaq _g_int(%rip), %rax
19 ; X64_DARWIN_PIC-NEXT: retq
21 ; X32-LABEL: test_global_ptrv:
22 ; X32: # %bb.0: # %entry
23 ; X32-NEXT: leal g_int, %eax
26 ; X32ABI-LABEL: test_global_ptrv:
27 ; X32ABI: # %bb.0: # %entry
28 ; X32ABI-NEXT: leal g_int, %eax
34 ; Function Attrs: noinline nounwind optnone uwtable
35 define i32 @test_global_valv() #3 {
36 ; X64-LABEL: test_global_valv:
37 ; X64: # %bb.0: # %entry
38 ; X64-NEXT: leaq g_int, %rax
39 ; X64-NEXT: movl (%rax), %eax
42 ; X64_DARWIN_PIC-LABEL: test_global_valv:
43 ; X64_DARWIN_PIC: ## %bb.0: ## %entry
44 ; X64_DARWIN_PIC-NEXT: leaq _g_int(%rip), %rax
45 ; X64_DARWIN_PIC-NEXT: movl (%rax), %eax
46 ; X64_DARWIN_PIC-NEXT: retq
48 ; X32-LABEL: test_global_valv:
49 ; X32: # %bb.0: # %entry
50 ; X32-NEXT: leal g_int, %eax
51 ; X32-NEXT: movl (%eax), %eax
54 ; X32ABI-LABEL: test_global_valv:
55 ; X32ABI: # %bb.0: # %entry
56 ; X32ABI-NEXT: leal g_int, %eax
57 ; X32ABI-NEXT: movl (%eax), %eax
60 %0 = load i32, i32* @g_int, align 4