summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-01-08 23:51:48 +0000
committerChad Rosier <mcrosier@apple.com>2013-01-08 23:51:48 +0000
commitd35ae732ac5440b111ac8b193c0fa9a3c1e74452 (patch)
tree60e4385e59871a9c8e8d5be59634723fd982b56d
parentbd49198409d070ff593cbb94fbf62b1975f455b5 (diff)
downloadbcm5719-llvm-d35ae732ac5440b111ac8b193c0fa9a3c1e74452.tar.gz
bcm5719-llvm-d35ae732ac5440b111ac8b193c0fa9a3c1e74452.zip
[ms-inline asm] Add a test case for the offset operator where the operand is a
global variable. llvm-svn: 171919
-rw-r--r--clang/test/CodeGen/ms-inline-asm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.c b/clang/test/CodeGen/ms-inline-asm.c
index 3ddfaf5e5c0..af88cc1fe18 100644
--- a/clang/test/CodeGen/ms-inline-asm.c
+++ b/clang/test/CodeGen/ms-inline-asm.c
@@ -138,13 +138,16 @@ void t14() {
// CHECK: call void asm sideeffect inteldialect ".if 1\0A\09mov eax, dword ptr $0\0A\09.else\0A\09mov ebx, j\0A\09.endif", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) nounwind
}
+int gvar = 10;
void t15() {
- int var = 10;
- __asm mov eax, var ; eax = 10
- __asm mov eax, offset var ; eax = address of myvar
+ int lvar = 10;
+ __asm mov eax, lvar ; eax = 10
+ __asm mov eax, offset lvar ; eax = address of lvar
+ __asm mov eax, offset gvar ; eax = address of gvar
// CHECK: t15
// CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) nounwind
// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}}) nounwind
+// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* @{{.*}}) nounwind
}
void t16() {
OpenPOWER on IntegriCloud