aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/MachO/x86_32-optimal_nop.s
blob: d21d1439e107805028fbc40390be1af3e910332b (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s

# 1 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        # nop
        # 0x90
        .align 1, 0x90
        ret
# 2 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        # xchg %ax,%ax
        # 0x66, 0x90
        .align 2, 0x90
        ret
# 3 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        # nopl (%[re]ax)
        # 0x0f, 0x1f, 0x00
        .align 2, 0x90
        ret
# 4 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        # nopl 0(%[re]ax)
        # 0x0f, 0x1f, 0x40, 0x00
        .align 3, 0x90
        ret
# 5 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        # nopl 0(%[re]ax,%[re]ax,1)
        # 0x0f, 0x1f, 0x44, 0x00, 0x00
        .align 3, 0x90
        ret
# 6 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        # nopw 0(%[re]ax,%[re]ax,1)
        # 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00
        .align 3, 0x90
        ret
# 7 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        # nopl 0L(%[re]ax)
        # 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00
        .align 3, 0x90
        ret
# 8 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        ret
        ret
        ret
        ret
        # nopl 0L(%[re]ax,%[re]ax,1)
        # 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
        .align 3, 0x90
        ret
# 9 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        ret
        ret
        ret
        # nopw 0L(%[re]ax,%[re]ax,1)
        # 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret
# 10 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        ret
        ret
        ret
        # nopw %cs:0L(%[re]ax,%[re]ax,1)
        # 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret
# 11 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        ret
        # nopw %cs:0L(%[re]ax,%[re]ax,1)
        # 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret
# 12 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        ret
        # nopw 0(%[re]ax,%[re]ax,1)
        # nopw 0(%[re]ax,%[re]ax,1)
        # 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00,
        # 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00
        .align 4, 0x90
        ret
# 13 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        ret
        # nopw 0(%[re]ax,%[re]ax,1)
        # nopl 0L(%[re]ax)
        # 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00,
        # 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret
# 14 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        ret
        # nopl 0L(%[re]ax)
        # nopl 0L(%[re]ax)
        # 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00,
        # 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret
# 15 byte nop test
        .align 4, 0 # start with 16 byte alignment filled with zeros
        ret
        # nopl 0L(%[re]ax)
        # nopl 0L(%[re]ax,%[re]ax,1)
        # 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00,
        # 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
        .align 4, 0x90
        ret

// CHECK: ('cputype', 7)
// CHECK: ('cpusubtype', 3)
// CHECK: ('filetype', 1)
// CHECK: ('num_load_commands', 1)
// CHECK: ('load_commands_size', 124)
// CHECK: ('flag', 0)
// CHECK: ('load_commands', [
// CHECK:   # Load Command 0
// CHECK:  (('command', 1)
// CHECK:   ('size', 124)
// CHECK:   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK:   ('vm_addr', 0)
// CHECK:   ('vm_size', 337)
// CHECK:   ('file_offset', 152)
// CHECK:   ('file_size', 337)
// CHECK:   ('maxprot', 7)
// CHECK:   ('initprot', 7)
// CHECK:   ('num_sections', 1)
// CHECK:   ('flags', 0)
// CHECK:   ('sections', [
// CHECK:     # Section 0
// CHECK:    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK:     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK:     ('address', 0)
// CHECK:     ('size', 337)
// CHECK:     ('offset', 152)
// CHECK:     ('alignment', 4)
// CHECK:     ('reloc_offset', 0)
// CHECK:     ('num_reloc', 0)
// CHECK:     ('flags', 0x80000400)
// CHECK:     ('reserved1', 0)
// CHECK:     ('reserved2', 0)
// CHECK:    ),
// CHECK:   ('_relocations', [
// CHECK:   ])
// CHECK:   ('_section_data', '\xc3\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\x0f\x1f@\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3f\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3f\x0f\x1fD\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3')
// CHECK:   ])
// CHECK:  ),
// CHECK: ])