forked from OSchip/llvm-project
AArch64: map bare-metal arm64-macho triple to MachO MC layer.
Far better than an assertion about expecting ELF. llvm-svn: 239647
This commit is contained in:
parent
ff715e2d5e
commit
02cfdbb7f1
|
@ -523,7 +523,7 @@ MCAsmBackend *llvm::createAArch64leAsmBackend(const Target &T,
|
||||||
const MCRegisterInfo &MRI,
|
const MCRegisterInfo &MRI,
|
||||||
const Triple &TheTriple,
|
const Triple &TheTriple,
|
||||||
StringRef CPU) {
|
StringRef CPU) {
|
||||||
if (TheTriple.isOSDarwin())
|
if (TheTriple.isOSBinFormatMachO())
|
||||||
return new DarwinAArch64AsmBackend(T, MRI);
|
return new DarwinAArch64AsmBackend(T, MRI);
|
||||||
|
|
||||||
assert(TheTriple.isOSBinFormatELF() && "Expect either MachO or ELF target");
|
assert(TheTriple.isOSBinFormatELF() && "Expect either MachO or ELF target");
|
||||||
|
|
|
@ -60,7 +60,7 @@ static MCRegisterInfo *createAArch64MCRegisterInfo(StringRef Triple) {
|
||||||
static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI,
|
static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI,
|
||||||
const Triple &TheTriple) {
|
const Triple &TheTriple) {
|
||||||
MCAsmInfo *MAI;
|
MCAsmInfo *MAI;
|
||||||
if (TheTriple.isOSDarwin())
|
if (TheTriple.isOSBinFormatMachO())
|
||||||
MAI = new AArch64MCAsmInfoDarwin();
|
MAI = new AArch64MCAsmInfoDarwin();
|
||||||
else {
|
else {
|
||||||
assert(TheTriple.isOSBinFormatELF() && "Only expect Darwin or ELF");
|
assert(TheTriple.isOSBinFormatELF() && "Only expect Darwin or ELF");
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
; RUN: llc -mtriple=arm64-macho -o - %s | FileCheck %s
|
||||||
|
; RUN: llc -mtriple=arm64-macho -filetype=obj -o %t %s
|
||||||
|
; RUN: llvm-objdump -triple=arm64-macho -d %t | FileCheck --check-prefix=CHECK-OBJ %s
|
||||||
|
|
||||||
|
define void @foo() {
|
||||||
|
; CHECK-LABEL: _foo:
|
||||||
|
; CHECK: ret
|
||||||
|
|
||||||
|
; CHECK-OBJ: 0: c0 03 5f d6 ret
|
||||||
|
|
||||||
|
ret void
|
||||||
|
}
|
Loading…
Reference in New Issue