1 // REQUIRES: x86-registered-target 2 3 // RUN: %clang_cc1 -triple x86_64-pc-win32 -fasm-blocks -emit-llvm %s -o - | FileCheck %s 4 class t1 { 5 public: 6 double a; 7 void runc(); 8 }; 9 10 class t2 { 11 public: 12 double a; 13 void runc(); 14 }; 15 16 // CHECK: define void @"\01?runc@t2@@ 17 void t2::runc() { 18 double num = 0; 19 __asm { 20 mov rax,[this] 21 // CHECK: [[THIS_ADDR_T2:%.+]] = alloca %class.t2* 22 // CHECK: [[THIS1_T2:%.+]] = load %class.t2*, %class.t2** [[THIS_ADDR_T2]], 23 // CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t2* [[THIS1_T2]] 24 mov rbx,[rax] 25 mov num, rbx 26 }; 27 } 28 29 // CHECK: define void @"\01?runc@t1@@ 30 void t1::runc() { 31 double num = 0; 32 __asm { 33 mov rax,[this] 34 // CHECK: [[THIS_ADDR_T1:%.+]] = alloca %class.t1* 35 // CHECK: [[THIS1_T1:%.+]] = load %class.t1*, %class.t1** [[THIS_ADDR_T1]], 36 // CHECK: call void asm sideeffect inteldialect "mov rax,qword ptr $1{{.*}}%class.t1* [[THIS1_T1]] 37 mov rbx,[rax] 38 mov num, rbx 39 }; 40 } 41 42 struct s { 43 int a; 44 // CHECK: define linkonce_odr void @"\01?func@s@@ 45 void func() { 46 __asm mov rax, [this] 47 // CHECK: [[THIS_ADDR_S:%.+]] = alloca %struct.s* 48 // CHECK: [[THIS1_S:%.+]] = load %struct.s*, %struct.s** [[THIS_ADDR_S]], 49 // CHECK: call void asm sideeffect inteldialect "mov rax, qword ptr $0{{.*}}%struct.s* [[THIS1_S]] 50 } 51 } f3; 52 53 int main() { 54 f3.func(); 55 f3.a=1; 56 return 0; 57 } 58