1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -relocation-model=static | FileCheck %s --check-prefix=x86_64-darwin
3 ; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu -relocation-model=static | FileCheck %s --check-prefix=x86_64-linux
5 @v = external global i32, align 8
6 @v_addr = external global ptr, align 8
8 define void @t() nounwind optsize {
9 ; x86_64-darwin-LABEL: t:
10 ; x86_64-darwin: ## %bb.0:
11 ; x86_64-darwin-NEXT: movq _v@GOTPCREL(%rip), %rax
12 ; x86_64-darwin-NEXT: movq _v_addr@GOTPCREL(%rip), %rcx
13 ; x86_64-darwin-NEXT: movq %rax, (%rcx)
14 ; x86_64-darwin-NEXT: ud2
16 ; x86_64-linux-LABEL: t:
17 ; x86_64-linux: # %bb.0:
18 ; x86_64-linux-NEXT: movq v@GOTPCREL(%rip), %rax
19 ; x86_64-linux-NEXT: movq v_addr@GOTPCREL(%rip), %rcx
20 ; x86_64-linux-NEXT: movq %rax, (%rcx)
21 store ptr @v, ptr @v_addr, align 8