1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | opt -strip -S | FileCheck %s
4 // Some test cases for MS inline asm support from Mozilla code base.
6 void invoke_copy_to_stack() {}
8 void invoke(void* that, unsigned methodIndex,
9 unsigned paramCount, void* params)
12 // CHECK: %5 = alloca i8*, align 4
13 // CHECK: %6 = alloca i32, align 4
14 // CHECK: %7 = alloca i32, align 4
15 // CHECK: %8 = alloca i8*, align 4
16 // CHECK: store i8* %0, i8** %5, align 4
17 // CHECK: store i32 %1, i32* %6, align 4
18 // CHECK: store i32 %2, i32* %7, align 4
19 // CHECK: store i8* %3, i8** %8, align 4
20 // CHECK: call void asm sideeffect inteldialect
21 // CHECK: mov edx,dword ptr $1
22 // CHECK: test edx,edx
23 // CHECK: jz {{[^_]*}}__MSASMLABEL_.0__noparams
24 // ^ Can't use {{.*}} here because the matching is greedy.
29 // CHECK: push dword ptr $0
30 // CHECK: call dword ptr $2
31 // CHECK: {{.*}}__MSASMLABEL_.0__noparams:
32 // CHECK: mov ecx,dword ptr $3
34 // CHECK: mov edx,[ecx]
35 // CHECK: mov eax,dword ptr $4
36 // CHECK: call dword ptr[edx+eax*$$4]
40 // CHECK: "=*m,*m,*m,*m,*m,~{eax},~{ebp},~{ecx},~{edx},~{flags},~{esp},~{dirflag},~{fpsr},~{flags}"
41 // CHECK: (i8** %8, i32* %7, void (...)* bitcast (void ()* @invoke_copy_to_stack to void (...)*), i8** %5, i32* %6)
52 call invoke_copy_to_stack
58 call dword ptr[edx+eax*4]