aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-10 00:00:34 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-10 00:00:34 +0000
commit74896e074856c3248d88ddddf45bfda7256ab022 (patch)
tree3912921f6e857ce91dc7bb6cc3d95e83aaad4ec5
parent5ad76c073e1822d11901a8552c6aa9372038b5f0 (diff)
[ms-inline asm] Use the new Inline Asm Non-Standard Dialect attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161642 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGStmt.cpp1
-rw-r--r--test/CodeGen/asm.c10
-rw-r--r--test/CodeGen/ms-inline-asm.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 2e4c557db6..467c77945e 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -1701,4 +1701,5 @@ void CodeGenFunction::EmitMSAsmStmt(const MSAsmStmt &S) {
llvm::InlineAsm::get(FTy, *S.getAsmString(), MachineClobbers, true);
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
Result->addAttribute(~0, llvm::Attribute::NoUnwind);
+ Result->addAttribute(~0, llvm::Attribute::IANSDialect);
}
diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c
index 84f26e1013..b0097368ec 100644
--- a/test/CodeGen/asm.c
+++ b/test/CodeGen/asm.c
@@ -220,3 +220,13 @@ typedef long long __m256i __attribute__((__vector_size__(32)));
void t26 (__m256i *p) {
__asm__ volatile("vmovaps %0, %%ymm0" :: "m" (*(__m256i*)p) : "ymm0");
}
+
+// Check to make sure the inline asm non-standard dialect attribute _not_ is
+// emitted.
+void t27(void) {
+ asm volatile("nop");
+// CHECK: @t27
+// CHECK: call void asm sideeffect "nop"
+// CHECK-NOT: ia_nsdialect
+// CHECK: ret void
+}
diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c
index 3234b98bfa..67bef9c75f 100644
--- a/test/CodeGen/ms-inline-asm.c
+++ b/test/CodeGen/ms-inline-asm.c
@@ -2,7 +2,7 @@
void t1() {
// CHECK: @t1
-// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind
+// CHECK: call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
// CHECK: ret void
__asm {}
}