1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/test/CodeGen/X86/x86-64-pic-12.ll
Matthias Braun 911ad50048 X86: Do not produce GOT relocations on windows
Windows has no GOT relocations the way elf/darwin has. Some people use
x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT
relocations for this target.

Differential Revision: https://reviews.llvm.org/D24627

llvm-svn: 283140
2016-10-03 20:11:24 +00:00

28 lines
595 B
LLVM

; RUN: llc -o - %s -relocation-model=pic | FileCheck %s
; Check that we do not get GOT relocations with the x86_64-pc-windows-macho
; triple.
target triple = "x86_64-pc-windows-macho"
@g = common global i32 0, align 4
declare i32 @extbar()
; CHECK-LABEL: bar:
; CHECK: callq _extbar
; CHECK: leaq _extbar(%rip),
; CHECK-NOT: @GOT
define i8* @bar() {
call i32 @extbar()
ret i8* bitcast (i32 ()* @extbar to i8*)
}
; CHECK-LABEL: foo:
; CHECK: callq _bar
; CHECK: movl _g(%rip),
; CHECK-NOT: @GOT
define i32 @foo() {
call i8* @bar()
%gval = load i32, i32* @g, align 4
ret i32 %gval
}