mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
[ARM] In thumb mode, emit directive ".code 16" before file level inline
assembly instructions. This is necessary to ensure ARM assembler switches to Thumb mode before it starts assembling the file level inline assembly instructions at the beginning of a .s file. <rdar://problem/17757232> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b64f8426f2
commit
642c8bef19
@ -478,6 +478,9 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||
// Emit ARM Build Attributes
|
||||
if (Subtarget->isTargetELF())
|
||||
emitAttributes();
|
||||
|
||||
if (!M.getModuleInlineAsm().empty() && Subtarget->isThumb())
|
||||
OutStreamer.EmitAssemblerFlag(MCAF_Code16);
|
||||
}
|
||||
|
||||
static void
|
||||
|
13
test/CodeGen/ARM/inlineasm-global.ll
Normal file
13
test/CodeGen/ARM/inlineasm-global.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llc -march thumb -no-integrated-as %s -o - | FileCheck %s --check-prefix=THUMB
|
||||
; RUN: llc -march arm -no-integrated-as %s -o - | FileCheck %s --check-prefix=ARM
|
||||
|
||||
; In thumb mode, emit ".code 16" before global inline-asm instructions.
|
||||
|
||||
; THUMB: .code 16
|
||||
; THUMB: stmib
|
||||
; THUMB: .code 16
|
||||
|
||||
; ARM-NOT: .code 16
|
||||
; ARM: stmib
|
||||
|
||||
module asm "stmib sp, {r0-r14};"
|
Loading…
Reference in New Issue
Block a user