blob: bc5f955d6876edd6d8999d857fe7d7ea88a49a87 [file] [log] [blame]
Krzysztof Parzyszek6c3b8372015-12-15 19:14:24 +00001// Hexagon build bot defines hexagon-unknown-elf as the default target triple,
2// which seems to trump the -triple argument for some reason.
3// UNSUPPORTED: hexagon
4
Michael Zuckerman724d02a2015-12-15 14:35:51 +00005// RUN: %clang_cc1 -triple x86_64-pc-win32 -fasm-blocks -emit-llvm %s -o - | FileCheck %s
Michael Zuckerman229158c2015-12-15 14:04:18 +00006class t1 {
7public:
8 double a;
9 void runc();
10};
11
12class t2 {
13public:
14 double a;
15 void runc();
16};
17
18void t2::runc() {
19 double num = 0;
20 __asm {
21 mov rax,[this]
22 //CHECK: %this.addr = alloca %class.t2*
23 //CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t2* %this1
24 mov rbx,[rax]
25 mov num, rbx
26 };
27}
28
29void t1::runc() {
30 double num = 0;
31 __asm {
32 mov rax,[this]
33 //CHECK: %this.addr = alloca %class.t1*
34 //CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t1* %this1
35 mov rbx,[rax]
36 mov num, rbx
37 };
38}
39
40struct s {
41 int a;
42 void func() {
43 __asm mov rax, [this]
44 //CHECK: %this.addr = alloca %struct.s*
45 //CHECK: call void asm sideeffect inteldialect "mov rax, qword ptr $0{{.*}}%struct.s* %this1
46 }
47} f3;
48
49int main() {
50 f3.func();
51 f3.a=1;
52 return 0;
53}