mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 12:05:48 -04:00

Don't try to generate large PIC code for non-ELF targets. Neither COFF nor MachO have relocations for large position independent code, and users have been using "large PIC" code models to JIT 64-bit code for a while now. With this change, if they are generating ELF code, their JITed code will truly be PIC, but if they target MachO or COFF, it will contain 64-bit immediates that directly reference external symbols. For a JIT, that's perfectly fine. llvm-svn: 337740
16 lines
477 B
LLVM
16 lines
477 B
LLVM
; RUN: llc < %s -relocation-model=pic -code-model=large | FileCheck %s
|
|
|
|
; CHECK-LABEL: foo:
|
|
; CHECK: movabsq $_xscanf, %[[REG:[^ ]*]]
|
|
; CHECK: callq *%[[REG]]
|
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
|
|
target triple = "x86_64-apple-darwin8"
|
|
|
|
declare void @xscanf(i64) nounwind
|
|
|
|
define void @foo() nounwind {
|
|
call void (i64) @xscanf( i64 0 ) nounwind
|
|
unreachable
|
|
}
|