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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier 2012-09-10 20:54:39 +00:00
parent b6d52a5b4a
commit 3c4ecd7dab
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)