diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-02-28 23:53:30 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-02-28 23:53:30 +0000 |
commit | c01810eeb7227010f73cb39e3c4fa0197a3c4ef0 (patch) | |
tree | 10b49a3600d9b9c798d9679ca3300348ac7eb606 /test/MC/MachO | |
parent | b62fbc5e469f532fd1747a3c24115fb1d0ba792f (diff) | |
download | external_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.zip external_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.tar.gz external_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.tar.bz2 |
ARM implement TargetInstrInfo::getNoopForMachoTarget()
Without this hook, functions w/ a completely empty body (including no
epilogue) will cause an MCEmitter assertion failure.
For example,
define internal fastcc void @empty_function() {
unreachable
}
rdar://10947471
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r-- | test/MC/MachO/ARM/empty-function-nop.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/MC/MachO/ARM/empty-function-nop.ll b/test/MC/MachO/ARM/empty-function-nop.ll new file mode 100644 index 0000000..3ac4d82 --- /dev/null +++ b/test/MC/MachO/ARM/empty-function-nop.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -filetype=obj -mtriple=thumbv6-apple-darwin -o - | macho-dump -dump-section-data | FileCheck -prefix=T1 +; RUN: llc < %s -filetype=obj -mtriple=thumbv7-apple-darwin -o - | macho-dump -dump-section-data | FileCheck -prefix=T2 +; RUN: llc < %s -filetype=obj -mtriple=armv6-apple-darwin -o - | macho-dump -dump-section-data | FileCheck -prefix=ARM +; RUN: llc < %s -filetype=obj -mtriple=armv7-apple-darwin -o - | macho-dump -dump-section-data | FileCheck -prefix=ARMV7 + +; Empty functions need a NOP in them for MachO to prevent DWARF FDEs from +; getting all mucked up. See lib/CodeGen/AsmPrinter/AsmPrinter.cpp for +; details. +define internal fastcc void @empty_function() { + unreachable +} +; CHECK-T1: ('_section_data', 'c046') +; CHECK-T2: ('_section_data', '00bf') +; CHECK-ARM: ('_section_data', '0000a0e1') +; CHECK-ARMV7: ('_section_data', '00f020e3') |