Index: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp =================================================================== --- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp +++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp @@ -391,8 +391,12 @@ return false; Lex(); if (L.isNot(AsmToken::At) && L.isNot(AsmToken::Percent) && - L.isNot(AsmToken::String)) - return TokError("expected '@', '%' or \"\""); + L.isNot(AsmToken::String)) { + if (L.getAllowAtInIdentifier()) + return TokError("expected '@', '%' or \"\""); + else + return TokError("expected '%' or \"\""); + } if (!L.is(AsmToken::String)) Lex(); if (L.is(AsmToken::Integer)) { Index: llvm/trunk/test/MC/ELF/ARM/gnu-type-hash-diagnostics.s =================================================================== --- llvm/trunk/test/MC/ELF/ARM/gnu-type-hash-diagnostics.s +++ llvm/trunk/test/MC/ELF/ARM/gnu-type-hash-diagnostics.s @@ -7,3 +7,7 @@ // CHECK: .type TYPE #32 // CHECK: ^ + // For ARM, the comment character is '@', so we don't list '@' as a + // valid option. + .section "foo", "a", @progbits +// CHECK: error: expected '%' or ""