blob: f169c72d9b896e2b90f73a390dd7e3432e67a38e [file] [log] [blame]
NAKAMURA Takumi512bd572015-12-15 22:19:00 +00001// REQUIRES: x86-registered-target
Krzysztof Parzyszek6c3b8372015-12-15 19:14:24 +00002
Michael Zuckerman724d02a2015-12-15 14:35:51 +00003// RUN: %clang_cc1 -triple x86_64-pc-win32 -fasm-blocks -emit-llvm %s -o - | FileCheck %s
Michael Zuckerman229158c2015-12-15 14:04:18 +00004class t1 {
5public:
6 double a;
7 void runc();
8};
9
10class t2 {
11public:
12 double a;
13 void runc();
14};
15
16void t2::runc() {
17 double num = 0;
18 __asm {
19 mov rax,[this]
20 //CHECK: %this.addr = alloca %class.t2*
21 //CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t2* %this1
22 mov rbx,[rax]
23 mov num, rbx
24 };
25}
26
27void t1::runc() {
28 double num = 0;
29 __asm {
30 mov rax,[this]
31 //CHECK: %this.addr = alloca %class.t1*
32 //CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t1* %this1
33 mov rbx,[rax]
34 mov num, rbx
35 };
36}
37
38struct s {
39 int a;
40 void func() {
41 __asm mov rax, [this]
42 //CHECK: %this.addr = alloca %struct.s*
43 //CHECK: call void asm sideeffect inteldialect "mov rax, qword ptr $0{{.*}}%struct.s* %this1
44 }
45} f3;
46
47int main() {
48 f3.func();
49 f3.a=1;
50 return 0;
51}