Skip to content

Commit cc01c83

Browse files
committed
[MC,test] Add a stress test for layout algorithm
Reduced from #100283
1 parent 9589c12 commit cc01c83

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## Contrived .zero directive example, simplified from the Linux kernel use case,
2+
## which requires multiple iterations to converge.
3+
## https://github.com/llvm/llvm-project/issues/100283
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
5+
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
6+
7+
# CHECK: 80: jne 0x0 <.text>
8+
# CHECK-EMPTY:
9+
10+
.text
11+
.Ltmp0:
12+
.Ltmp1:
13+
cli
14+
popq %rdi
15+
text1:
16+
.zero (.Ltmp2-.Ltmp3)
17+
.section "","ax",@progbits
18+
.Ltmp3:
19+
movq $0, %rax
20+
.Ltmp4:
21+
.Ltmp5:
22+
.section .discard.intra_function_calls,"ax",@progbits
23+
.long .Ltmp5
24+
.section "","ax",@progbits
25+
callq .Ltmp6
26+
int3
27+
.Ltmp7:
28+
.Ltmp8:
29+
.section .discard.intra_function_calls,"ax",@progbits
30+
.long .Ltmp8
31+
.section "","ax",@progbits
32+
callq .Ltmp6
33+
int3
34+
.Ltmp6:
35+
addq $0, %rsp
36+
decq %rax
37+
jne .Ltmp4
38+
lfence
39+
movq $-1, %gs:pcpu_hot+6
40+
41+
.Ltmp2:
42+
.text
43+
text2:
44+
45+
.zero (.Ltmp9-.Ltmp10)
46+
.section "","ax",@progbits
47+
.Ltmp10:
48+
jmp .Ltmp11
49+
.Ltmp9:
50+
.text
51+
text3:
52+
53+
.Ltmp12:
54+
.zero (.Ltmp13-.Ltmp14)
55+
.section "","ax",@progbits
56+
.Ltmp14:
57+
callq entry_untrain_ret
58+
.Ltmp13:
59+
.text
60+
61+
.zero (.Ltmp15-.Ltmp16)
62+
.section "","ax",@progbits
63+
.Ltmp16:
64+
xorl %eax, %eax
65+
btsq $63, %rax
66+
movq %rax, %gs:pcpu_hot+6
67+
68+
.Ltmp15:
69+
.text
70+
71+
popq %r12
72+
popq rbp
73+
jmp __x86_return_thunk
74+
movl 936(%rdi), %eax
75+
cmpl %gs:x86_spec_ctrl_current, %eax
76+
je .Ltmp0
77+
movl edx, %edx
78+
wrmsr
79+
jmp .Ltmp0
80+
.Ltmp11:
81+
movl $72, %ecx
82+
jmp .Ltmp12
83+
cmpb $0, kvm_rebooting
84+
jne .Ltmp1

0 commit comments

Comments
 (0)