diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index d6f9236077e..80e101f748b 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 00000000000..461f843c692 --- /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