From 36a321160e61149088f306c3605a9ad5fdd67e0a Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 19 Jun 2014 17:15:36 +0000 Subject: MCNullStreamer: assign file IDs to resolve crashes and errors Use the MCStreamer base implementations for file ID tracking instead of overriding them as no-ops. Avoids assertions when streaming Dwarf debug info, and fixes ASM parsing of loc and file directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211282 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/DebugInfo/global.ll | 3 +++ test/MC/AsmParser/directive_file.s | 1 + test/MC/AsmParser/directive_line.s | 1 + test/MC/AsmParser/directive_loc.s | 1 + 4 files changed, 6 insertions(+) (limited to 'test') diff --git a/test/DebugInfo/global.ll b/test/DebugInfo/global.ll index c515114fd5..3c97f0cb22 100644 --- a/test/DebugInfo/global.ll +++ b/test/DebugInfo/global.ll @@ -3,6 +3,9 @@ ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t ; RUN: llvm-dwarfdump %t | FileCheck %s +; Also test that the null streamer doesn't crash with debug info. +; RUN: %llc_dwarf -O0 -filetype=null < %s + ; generated from the following source compiled to bitcode with clang -g -O1 ; static int i; ; int main() { diff --git a/test/MC/AsmParser/directive_file.s b/test/MC/AsmParser/directive_file.s index 9b99e0f24e..d7290ebe1d 100644 --- a/test/MC/AsmParser/directive_file.s +++ b/test/MC/AsmParser/directive_file.s @@ -1,4 +1,5 @@ # RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s +# RUN: llvm-mc -triple i386-unknown-unknown %s -filetype=null .file "hello" .file 1 "worl\144" # "\144" is "d" diff --git a/test/MC/AsmParser/directive_line.s b/test/MC/AsmParser/directive_line.s index 94ce446029..110b68a462 100644 --- a/test/MC/AsmParser/directive_line.s +++ b/test/MC/AsmParser/directive_line.s @@ -1,4 +1,5 @@ # RUN: llvm-mc -triple i386-unknown-unknown %s +# RUN: llvm-mc -triple i386-unknown-unknown %s -filetype=null # FIXME: Actually test the output. .line diff --git a/test/MC/AsmParser/directive_loc.s b/test/MC/AsmParser/directive_loc.s index cda9579fb2..404ebcecdd 100644 --- a/test/MC/AsmParser/directive_loc.s +++ b/test/MC/AsmParser/directive_loc.s @@ -1,4 +1,5 @@ # RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s +# RUN: llvm-mc -triple i386-unknown-unknown %s -filetype=null .file 1 "hello" # CHECK: .file 1 "hello" -- cgit v1.2.3