1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

R600: Fix assert on empty function

If a function is just an unreachable, this would hit a
"this is not a MachO target" assertion because of setting
HasSubsectionViaSymbols.

llvm-svn: 221920
This commit is contained in:
Matt Arsenault 2014-11-13 20:07:40 +00:00
parent 3ed9ac191d
commit 2ef28e2234
2 changed files with 20 additions and 1 deletions

View File

@ -14,7 +14,6 @@ using namespace llvm;
AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() {
HasSingleParameterDotFile = false;
//===------------------------------------------------------------------===//
HasSubsectionsViaSymbols = true;
MaxInstLength = 16;
SeparatorString = "\n";
CommentString = ";";

View File

@ -0,0 +1,20 @@
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
; Make sure we don't assert on empty functions
; SI-LABEL: {{^}}empty_function_ret:
; SI: .text
; SI: s_endpgm
; SI: codeLenInByte = 4
define void @empty_function_ret() #0 {
ret void
}
; SI-LABEL: {{^}}empty_function_unreachable:
; SI: .text
; SI: codeLenInByte = 0
define void @empty_function_unreachable() #0 {
unreachable
}
attributes #0 = { nounwind }