Michael Zuckerman | 724d02a | 2015-12-15 14:35:51 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-pc-win32 -fasm-blocks -emit-llvm %s -o - | FileCheck %s |
Michael Zuckerman | 229158c | 2015-12-15 14:04:18 +0000 | [diff] [blame] | 2 | class t1 { |
| 3 | public: |
| 4 | double a; |
| 5 | void runc(); |
| 6 | }; |
| 7 | |
| 8 | class t2 { |
| 9 | public: |
| 10 | double a; |
| 11 | void runc(); |
| 12 | }; |
| 13 | |
| 14 | void 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 | |
| 25 | void 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 | |
| 36 | struct 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 | |
| 45 | int main() { |
| 46 | f3.func(); |
| 47 | f3.a=1; |
| 48 | return 0; |
| 49 | } |