[ms-inline asm] Add support for .att_syntax directive.

llvm-svn: 163542
This commit is contained in:
Chad Rosier 2012-09-10 20:54:39 +00:00
parent 41f2b940c9
commit 6f8d8b2406
2 changed files with 8 additions and 3 deletions

View File

@ -1745,7 +1745,10 @@ bool X86AsmParser::ParseDirective(AsmToken DirectiveID) {
return ParseDirectiveWord(2, DirectiveID.getLoc());
else if (IDVal.startswith(".code"))
return ParseDirectiveCode(IDVal, DirectiveID.getLoc());
else if (IDVal.startswith(".intel_syntax")) {
else if (IDVal.startswith(".att_syntax")) {
getParser().setAssemblerDialect(0);
return false;
} else if (IDVal.startswith(".intel_syntax")) {
getParser().setAssemblerDialect(1);
if (getLexer().isNot(AsmToken::EndOfStatement)) {
if(Parser.getTok().getString() == "noprefix") {

View File

@ -1,7 +1,9 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown %s | FileCheck %s
// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=att %s | FileCheck %s
.intel_syntax
_test:
// CHECK: movl $257, -4(%rsp)
mov DWORD PTR [RSP - 4], 257
.att_syntax
// CHECK: movl $257, -4(%rsp)
movl $257, -4(%rsp)