diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-01-08 23:51:48 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-01-08 23:51:48 +0000 |
commit | 6949ab1f5e81deccc8053dcb0eeeaa8498a91070 (patch) | |
tree | 9557539b3b90b12a3f33b34634a82df99dcc3050 /test/CodeGen/ms-inline-asm.c | |
parent | b20eb10c8f51d26b0c486f345db25e26f96acb06 (diff) |
[ms-inline asm] Add a test case for the offset operator where the operand is a
global variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ms-inline-asm.c')
-rw-r--r-- | test/CodeGen/ms-inline-asm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/CodeGen/ms-inline-asm.c b/test/CodeGen/ms-inline-asm.c index 3ddfaf5e5c..af88cc1fe1 100644 --- a/test/CodeGen/ms-inline-asm.c +++ b/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() { |