Skip to content

Commit a49a9dd

Browse files
committed
MC,test: Add a MCFillFragment stress test from llvm#123402
This will be resolved by an upcoming change that changes the fragment relaxation algorithm.
1 parent c5cce48 commit a49a9dd

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## This contrived .space example previously triggered "invalid number of bytes" error.
2+
## https://github.com/llvm/llvm-project/issues/123402
3+
# RUN: not llvm-mc -filetype=obj -triple=x86_64 %s -o /dev/null 2>&1 | FileCheck %s
4+
5+
# CHECK: error: invalid number of bytes
6+
7+
.section .p,"ax"
8+
p_1st:
9+
0: pause
10+
lfence
11+
jmp 0b
12+
13+
.section .q,"ax"
14+
q_1st:
15+
addl 11,%eax
16+
addl 22,%eax
17+
18+
q_cli:
19+
cli
20+
0: pause
21+
lfence
22+
jmp 0b
23+
24+
.section .p
25+
.space (q_cli - q_1st) - (. - p_1st), 0xcc
26+
cli
27+
28+
.section .q
29+
q_sti:
30+
sti
31+
32+
.section .p
33+
.space (q_sti - q_1st) - (. - p_1st), 0xcc
34+
sti
35+
addl 33,%eax
36+
addl 44,%eax
37+
p_nop:
38+
nop
39+
40+
.section .q
41+
0: pause
42+
lfence
43+
jmp 0b
44+
.space (p_nop - p_1st) - (. - q_1st), 0xcc
45+
nop

0 commit comments

Comments
 (0)