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