aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-05-12 11:18:59 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-05-12 11:18:59 +0000
commite14a3c5084838b40bca4b006cbf78500c874a043 (patch)
treee0e08246205e8a34bdebf0b4bb11d092c334b54c
parentdec06ef43114ca0f7e5a616ca7437be6e98ea0b3 (diff)
AsmParser: ignore the .extern directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156707 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/MC/MCParser/AsmParser.cpp4
-rw-r--r--test/MC/AsmParser/extern.s4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index d6f9236077..80e101f748 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -1220,6 +1220,10 @@ bool AsmParser::ParseStatement() {
// Symbol attribute directives
+ if (IDVal == ".extern") {
+ EatToEndOfStatement(); // .extern is the default, ignore it.
+ return false;
+ }
if (IDVal == ".globl" || IDVal == ".global")
return ParseDirectiveSymbolAttribute(MCSA_Global);
if (IDVal == ".indirect_symbol")
diff --git a/test/MC/AsmParser/extern.s b/test/MC/AsmParser/extern.s
new file mode 100644
index 0000000000..461f843c69
--- /dev/null
+++ b/test/MC/AsmParser/extern.s
@@ -0,0 +1,4 @@
+# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
+
+# CHECK-NOT: foo
+.extern foo