Skip to content
Snippets Groups Projects
Commit d35ae732 authored by Chad Rosier's avatar Chad Rosier
Browse files

[ms-inline asm] Add a test case for the offset operator where the operand is a

global variable.

llvm-svn: 171919
parent bd491984
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment