From: Chad Rosier Date: Tue, 8 Jan 2013 23:51:48 +0000 (+0000) Subject: [ms-inline asm] Add a test case for the offset operator where the operand is a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6949ab1f5e81deccc8053dcb0eeeaa8498a91070;p=clang [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 --- 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() {