llvm-project/llvm/test/CodeGen/X86/cleanuppad-large-codemodel.ll
Reid Kleckner 980c4df037 Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"
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
2018-07-23 21:14:35 +00:00

28 lines
694 B
LLVM

; RUN: llc -mtriple=x86_64-pc-windows-msvc -code-model=large -relocation-model=static -o - < %s | FileCheck %s
declare i32 @__CxxFrameHandler3(...)
declare void @bar()
define void @foo() personality i32 (...)* @__CxxFrameHandler3 {
entry:
invoke void @bar()
to label %exit unwind label %cleanup
cleanup:
%c = cleanuppad within none []
call void @bar() [ "funclet"(token %c) ]
cleanupret from %c unwind to caller
exit:
ret void
}
; CHECK: foo: # @foo
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
; CHECK: callq *%[[reg]]
; CHECK: retq
; CHECK: "?dtor$2@?0?foo@4HA":
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
; CHECK: callq *%[[reg]]
; CHECK: retq # CLEANUPRET