aboutsummaryrefslogtreecommitdiff
path: root/test/MC/X86/x86-32-ms-inline-asm.s
blob: 5524c706cc5caf88a49efd082cce044ea9bc7b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// RUN: llvm-mc -x86-asm-syntax=intel -triple i386-unknown-unknown --show-encoding %s | FileCheck %s

mov eax, [ebx].0
mov [ebx].4, ecx

// CHECK: movl (%ebx), %eax
// CHECK: encoding: [0x8b,0x03]
// CHECK: movl %ecx, 4(%ebx)
// CHECK: encoding: [0x89,0x4b,0x04]
        
_t21:                                   ## @t21
// CHECK: t21
	mov eax, [4*eax + 4]
// CHECK: movl 4(,%eax,4), %eax
// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
    mov eax, [4*eax][4]
// CHECK: movl 4(,%eax,4), %eax
// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
        
	mov eax, [esi + eax]
// CHECK: movl (%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x04,0x06]
	mov eax, [esi][eax]
// CHECK: movl (%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x04,0x06]
        
	mov eax, [esi + 4*eax]
// CHECK: movl (%esi,%eax,4), %eax
// CHECK: # encoding: [0x8b,0x04,0x86]
	mov eax, [esi][4*eax]
// CHECK: movl (%esi,%eax,4), %eax
// CHECK: # encoding: [0x8b,0x04,0x86]

    mov eax, [esi + eax + 4]
// CHECK: movl 4(%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
	mov eax, [esi][eax + 4]
// CHECK: movl 4(%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
	mov eax, [esi + eax][4]
// CHECK: movl 4(%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
	mov eax, [esi][eax][4]
// CHECK: movl 4(%esi,%eax), %eax
// CHECK: # encoding: [0x8b,0x44,0x06,0x04]

	mov eax, [esi + 2*eax + 4]
// CHECK: movl 4(%esi,%eax,2), %eax
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
	mov eax, [esi][2*eax + 4]
// CHECK: movl 4(%esi,%eax,2), %eax
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
	mov eax, [esi + 2*eax][4]
// CHECK: movl 4(%esi,%eax,2), %eax
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
	mov eax, [esi][2*eax][4]
// CHECK: movl 4(%esi,%eax,2), %eax
// CHECK: # encoding: [0x8b,0x44,0x46,0x04]

    pusha
// CHECK: pushal
// CHECK: # encoding: [0x60]
    popa
// CHECK: popal
// CHECK: # encoding: [0x61]
    pushad
// CHECK: pushal
// CHECK: # encoding: [0x60]
    popad
// CHECK: popal
// CHECK: # encoding: [0x61]

	ret