mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()
Small test for sanity check of resulting ARM .s file. Tested against -r115129. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115133 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
12ad94e03c
commit
afd1cc2578
@ -43,6 +43,7 @@ enum MCSymbolAttr {
|
||||
};
|
||||
|
||||
enum MCAssemblerFlag {
|
||||
MCAF_SyntaxUnified, ///< .syntax (ARM/ELF)
|
||||
MCAF_SubsectionsViaSymbols ///< .subsections_via_symbols (MachO)
|
||||
};
|
||||
|
||||
|
@ -244,6 +244,7 @@ void MCAsmStreamer::EmitLabel(MCSymbol *Symbol) {
|
||||
void MCAsmStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
|
||||
switch (Flag) {
|
||||
default: assert(0 && "Invalid flag!");
|
||||
case MCAF_SyntaxUnified: OS << "\t.syntax unified"; break;
|
||||
case MCAF_SubsectionsViaSymbols: OS << ".subsections_via_symbols"; break;
|
||||
}
|
||||
EmitEOL();
|
||||
|
@ -197,6 +197,7 @@ void MCELFStreamer::EmitLabel(MCSymbol *Symbol) {
|
||||
|
||||
void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
|
||||
switch (Flag) {
|
||||
case MCAF_SyntaxUnified: return; // no-op here?
|
||||
case MCAF_SubsectionsViaSymbols:
|
||||
getAssembler().setSubsectionsViaSymbols(true);
|
||||
return;
|
||||
|
@ -416,7 +416,7 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||
}
|
||||
|
||||
// Use unified assembler syntax.
|
||||
OutStreamer.EmitRawText(StringRef("\t.syntax unified"));
|
||||
OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified);
|
||||
|
||||
// Emit ARM Build Attributes
|
||||
if (Subtarget->isTargetELF()) {
|
||||
|
13
test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
Normal file
13
test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s
|
||||
; This tests that MC/asm header conversion is smooth
|
||||
;
|
||||
; CHECK: .syntax unified
|
||||
; CHECK-NEXT: .eabi_attribute 20, 1
|
||||
; CHECK-NEXT: .eabi_attribute 21, 1
|
||||
; CHECK-NEXT: .eabi_attribute 23, 3
|
||||
; CHECK-NEXT: .eabi_attribute 24, 1
|
||||
; CHECK-NEXT: .eabi_attribute 25, 1
|
||||
|
||||
define i32 @f(i64 %z) {
|
||||
ret i32 0
|
||||
}
|
Loading…
Reference in New Issue
Block a user