summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms-inline-asm.c
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-09-13 00:06:55 +0000
committerChad Rosier <mcrosier@apple.com>2012-09-13 00:06:55 +0000
commitb261a50b40f5bfab8e24412c271085061ad4defe (patch)
treea3886f289ca9c930b245e22e670c0fc974696d2a /clang/test/CodeGen/ms-inline-asm.c
parent31ce693f936810de870d03964ec8c9ec04f4e4b6 (diff)
downloadbcm5719-llvm-b261a50b40f5bfab8e24412c271085061ad4defe.tar.gz
bcm5719-llvm-b261a50b40f5bfab8e24412c271085061ad4defe.zip
[ms-inline asm] Handle the enumeration of input and output expressions in a
more robust way to address a few FIXMEs. The initial implementation, r163342, built the IR asm string and then tried to patch things on the fly without enough context. Specifically, it didn't skip mnemonics nor did it track with assembly instruction an expression was related to. The new implementation patches the operands and then builds the final IR string. llvm-svn: 163756
Diffstat (limited to 'clang/test/CodeGen/ms-inline-asm.c')
-rw-r--r--clang/test/CodeGen/ms-inline-asm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.c b/clang/test/CodeGen/ms-inline-asm.c
index b08f869ac44..b6bc3853f5c 100644
--- a/clang/test/CodeGen/ms-inline-asm.c
+++ b/clang/test/CodeGen/ms-inline-asm.c
@@ -151,3 +151,16 @@ void t18(void) {
// CHECK: t18
// CHECK: call void asm sideeffect inteldialect "mov dword ptr [eax], eax", "~{dirflag},~{fpsr},~{flags}"() nounwind
}
+
+unsigned t19(void) {
+ unsigned i = 1, j, l = 1, m;
+ __asm {
+ mov eax, i
+ mov j, eax
+ mov eax, l
+ mov m, eax
+ }
+ return j + m;
+// CHECK: t19
+// CHECK: call { i32, i32 } asm sideeffect inteldialect "mov eax, $2\0A\09mov $0, eax\0A\09mov eax, $3\0A\09mov $1, eax", "=r,=r,r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %{{.*}}, i32 %{{.*}}) nounwind
+}
OpenPOWER on IntegriCloud