1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/x86-store-gv-addr.ll
Fangrui Song be0cac5b4f [TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Static model
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable global variables,
we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal.
(Actually the long-term goal (started by r324535) is to remove as much
additional implied dso_local in TargetMachine:shouldAssumeDSOLocal as possible.)

By not implying dso_local, we will respect dso_local/dso_preemptable specifiers
set by the frontend. This allows the proposed -fno-direct-access-external-data
option to work with -fno-pic and prevent copy relocations.

This patch should be NFC in terms of the Clang behavior because the case we
don't set dso_local is a case Clang sets dso_local. However, some tests don't
set dso_local on some `external global` and expose some differences. Most tests
have been fixed to be more robust in previous commits.
2020-12-04 19:03:41 -08:00

24 lines
916 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-darwin -relocation-model=static | FileCheck %s --check-prefix=x86_64-darwin
; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu -relocation-model=static | FileCheck %s --check-prefix=x86_64-linux
@v = external global i32, align 8
@v_addr = external global i32*, align 8
define void @t() nounwind optsize {
; x86_64-darwin-LABEL: t:
; x86_64-darwin: ## %bb.0:
; x86_64-darwin-NEXT: movq _v@{{.*}}(%rip), %rax
; x86_64-darwin-NEXT: movq _v_addr@{{.*}}(%rip), %rcx
; x86_64-darwin-NEXT: movq %rax, (%rcx)
; x86_64-darwin-NEXT: ud2
;
; x86_64-linux-LABEL: t:
; x86_64-linux: # %bb.0:
; x86_64-linux-NEXT: movq v@{{.*}}(%rip), %rax
; x86_64-linux-NEXT: movq v_addr@{{.*}}(%rip), %rcx
; x86_64-linux-NEXT: movq %rax, (%rcx)
store i32* @v, i32** @v_addr, align 8
unreachable
}