summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-16 17:10:59 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-16 17:10:59 +0000
commit592b90a4763673471ac2d684e999a3865d35b5ee (patch)
tree8440f454e28342cca0ebc5b5912669873dcd6299 /clang/test
parent80c13773e3a49b23d2c20da3545099686cbbcbd9 (diff)
downloadbcm5719-llvm-592b90a4763673471ac2d684e999a3865d35b5ee.tar.gz
bcm5719-llvm-592b90a4763673471ac2d684e999a3865d35b5ee.zip
[ms-inline asm] Start tracking which tokens are registers and which are
variables, function or label references. The former is a potential clobber. The latter is either an input or an output. Unfortunately, it's difficult to test this patch at the moment, but the added test case will eventually do so. llvm-svn: 162026
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/ms-inline-asm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.c b/clang/test/CodeGen/ms-inline-asm.c
index ee4ca019c73..43ecbe34f47 100644
--- a/clang/test/CodeGen/ms-inline-asm.c
+++ b/clang/test/CodeGen/ms-inline-asm.c
@@ -82,3 +82,20 @@ void t10() {
// CHECK: t10
// CHECK: call void asm sideeffect "push ebx\0Amov ebx, 0x07\0Apop ebx", "~{ebx},~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
}
+
+unsigned t11(void) {
+ unsigned i = 1, j;
+ __asm {
+ mov eax, i
+ mov j, eax
+ }
+ return j;
+// CHECK: t11
+// CHECK: entry:
+// CHECK: [[I:%[a-zA-Z0-9]+]] = alloca i32, align 4
+// CHECK: [[J:%[a-zA-Z0-9]+]] = alloca i32, align 4
+// CHECK: store i32 1, i32* [[I]], align 4
+// CHECK: call void asm sideeffect "mov eax, i\0Amov j, eax", "~{dirflag},~{fpsr},~{flags}"() nounwind ia_nsdialect
+// CHECK: [[RET:%[a-zA-Z0-9]+]] = load i32* [[J]], align 4
+// CHECK: ret i32 [[RET]]
+}
OpenPOWER on IntegriCloud