This is x86 specific, and adds statefulness to MachineModuleInfo. Instead of explicitly tracking this, infer if we need to declare the symbol based on the reference previously inserted. This produces a small change in the output due to the move from AsmPrinter::doFinalization to X86's emitEndOfAsmFile. This will now be moved relative to other end of file fields, which I'm assuming doesn't matter (e.g. the __morestack_addr declaration is now after the .note.GNU-split-stack part) This also produces another small change in code if the module happened to define/declare __morestack_addr, but I assume that's invalid and doesn't really matter.
11 lines
355 B
LLVM
11 lines
355 B
LLVM
; RUN: llc -mcpu=generic -mtriple=x86_64-linux -code-model=large < %s | FileCheck %s
|
|
|
|
; Check what happens if we have an existing declaration of __morestack_addr
|
|
|
|
; CHECK: .section ".note.GNU-stack","",@progbits
|
|
; CHECK-NEXT: .section .rodata,"a",@progbits
|
|
; CHECK-NEXT: __morestack_addr:
|
|
; CHECK-NEXT: .quad __morestack
|
|
|
|
declare void @__morestack_addr()
|