Krzysztof Parzyszek | 6c3b837 | 2015-12-15 19:14:24 +0000 | [diff] [blame] | 1 | // 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 Zuckerman | 724d02a | 2015-12-15 14:35:51 +0000 | [diff] [blame] | 5 | // 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] | 6 | class t1 { |
| 7 | public: |
| 8 | double a; |
| 9 | void runc(); |
| 10 | }; |
| 11 | |
| 12 | class t2 { |
| 13 | public: |
| 14 | double a; |
| 15 | void runc(); |
| 16 | }; |
| 17 | |
| 18 | void 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 | |
| 29 | void 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 | |
| 40 | struct 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 | |
| 49 | int main() { |
| 50 | f3.func(); |
| 51 | f3.a=1; |
| 52 | return 0; |
| 53 | } |