summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-25 19:02:58 +0000
committerChris Lattner <sabre@nondot.org>2010-01-25 19:02:58 +0000
commitd45adf28de2f92242335d65ea3a3060ef638182c (patch)
tree70f7cfe9d023319c0a461c9175bf3f5b6e806cf0 /llvm
parent601ef33c77349054b35434d9f53893068707c8f0 (diff)
downloadbcm5719-llvm-d45adf28de2f92242335d65ea3a3060ef638182c.tar.gz
bcm5719-llvm-d45adf28de2f92242335d65ea3a3060ef638182c.zip
wirte up .file and .file to the mc asmparser.
llvm-svn: 94438
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp10
-rw-r--r--llvm/test/MC/AsmParser/directive_file.s7
2 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 077d2dffa65..d5bc396103f 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1708,14 +1708,18 @@ bool AsmParser::ParseDirectiveFile(StringRef, SMLoc DirectiveLoc) {
if (Lexer.isNot(AsmToken::String))
return TokError("unexpected token in '.file' directive");
- StringRef ATTRIBUTE_UNUSED FileName = getTok().getString();
+ StringRef Filename = getTok().getString();
+ Filename = Filename.substr(1, Filename.size()-2);
Lex();
if (Lexer.isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in '.file' directive");
- // FIXME: Do something with the .file.
-
+ if (FileNumber == -1)
+ Out.EmitFileDirective(Filename);
+ else
+ Out.EmitDwarfFileDirective(FileNumber, Filename);
+
return false;
}
diff --git a/llvm/test/MC/AsmParser/directive_file.s b/llvm/test/MC/AsmParser/directive_file.s
index ec0b9543b94..3160d5c2bfd 100644
--- a/llvm/test/MC/AsmParser/directive_file.s
+++ b/llvm/test/MC/AsmParser/directive_file.s
@@ -1,5 +1,8 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s
-# FIXME: Actually test the output.
+# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
.file "hello"
.file 1 "world"
+
+# CHECK: .file "hello"
+# CHECK: .file 1 "world"
+
OpenPOWER on IntegriCloud