Skip to content

Commit 8e4fdff

Browse files
authored
[X86] Update tailcc-ssp.ll assertions using update_llc_test_checks.py (#143500)
The assertions in llvm/test/CodeGen/X86/tailcc-ssp.ll were outdated. The initial comment indicated they were generated with `utils/update_llc_test_checks.py UTC_ARGS: --version 5`, but this was not accurate based on the file's content. Running `utils/update_llc_test_checks.py` regenerated the assertions, aligning them with the current `llc` output. This commit ensures that the test's claimed behavior accurately reflects the actual `llc` output, even though the tests were already passing. This was identified by @efriedma-quic during review of #136290. Submitting a separate PR to make sure these changes stay isolated.
1 parent 1d1f9af commit 8e4fdff

File tree

1 file changed

+43
-12
lines changed

1 file changed

+43
-12
lines changed

llvm/test/CodeGen/X86/tailcc-ssp.ll

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ define void @tailcall_unrelated_frame() sspreq {
7878
; WINDOWS-NEXT: callq __security_check_cookie
7979
; WINDOWS-NEXT: int3
8080
; WINDOWS-NEXT: .seh_endproc
81-
81+
;
8282
; LINUX-LABEL: tailcall_unrelated_frame:
8383
; LINUX: # %bb.0:
8484
; LINUX-NEXT: pushq %rax
@@ -97,6 +97,7 @@ define void @tailcall_unrelated_frame() sspreq {
9797
; LINUX-NEXT: .cfi_def_cfa_offset 16
9898
; LINUX-NEXT: callq __stack_chk_fail@PLT
9999

100+
100101
call void @bar()
101102
tail call void @bar()
102103
ret void
@@ -105,18 +106,48 @@ define void @tailcall_unrelated_frame() sspreq {
105106
declare void @callee()
106107
define void @caller() sspreq {
107108
; WINDOWS-LABEL: caller:
108-
; WINDOWS: callq callee
109-
; WINDOWS: callq callee
110-
; WINDOWS: cmpq __security_cookie(%rip), %rcx
111-
; WINDOWS: jne
112-
; WINDOWS: callq __security_check_cookie
113-
109+
; WINDOWS: # %bb.0:
110+
; WINDOWS-NEXT: subq $40, %rsp
111+
; WINDOWS-NEXT: .seh_stackalloc 40
112+
; WINDOWS-NEXT: .seh_endprologue
113+
; WINDOWS-NEXT: movq __security_cookie(%rip), %rax
114+
; WINDOWS-NEXT: xorq %rsp, %rax
115+
; WINDOWS-NEXT: movq %rax, {{[0-9]+}}(%rsp)
116+
; WINDOWS-NEXT: callq callee
117+
; WINDOWS-NEXT: callq callee
118+
; WINDOWS-NEXT: movq {{[0-9]+}}(%rsp), %rcx
119+
; WINDOWS-NEXT: xorq %rsp, %rcx
120+
; WINDOWS-NEXT: cmpq __security_cookie(%rip), %rcx
121+
; WINDOWS-NEXT: jne .LBB2_2
122+
; WINDOWS-NEXT: # %bb.1:
123+
; WINDOWS-NEXT: .seh_startepilogue
124+
; WINDOWS-NEXT: addq $40, %rsp
125+
; WINDOWS-NEXT: .seh_endepilogue
126+
; WINDOWS-NEXT: retq
127+
; WINDOWS-NEXT: .LBB2_2:
128+
; WINDOWS-NEXT: callq __security_check_cookie
129+
; WINDOWS-NEXT: int3
130+
; WINDOWS-NEXT: .seh_endproc
131+
;
114132
; LINUX-LABEL: caller:
115-
; LINUX: callq callee@PLT
116-
; LINUX: callq callee@PLT
117-
; LINUX: cmpq
118-
; LINUX: jne
119-
; LINUX: callq __stack_chk_fail@PLT
133+
; LINUX: # %bb.0:
134+
; LINUX-NEXT: pushq %rax
135+
; LINUX-NEXT: .cfi_def_cfa_offset 16
136+
; LINUX-NEXT: movq %fs:40, %rax
137+
; LINUX-NEXT: movq %rax, (%rsp)
138+
; LINUX-NEXT: callq callee@PLT
139+
; LINUX-NEXT: callq callee@PLT
140+
; LINUX-NEXT: movq %fs:40, %rax
141+
; LINUX-NEXT: cmpq (%rsp), %rax
142+
; LINUX-NEXT: jne .LBB2_2
143+
; LINUX-NEXT: # %bb.1: # %SP_return
144+
; LINUX-NEXT: popq %rax
145+
; LINUX-NEXT: .cfi_def_cfa_offset 8
146+
; LINUX-NEXT: retq
147+
; LINUX-NEXT: .LBB2_2: # %CallStackCheckFailBlk
148+
; LINUX-NEXT: .cfi_def_cfa_offset 16
149+
; LINUX-NEXT: callq __stack_chk_fail@PLT
150+
120151

121152
tail call void @callee()
122153
call void @callee()

0 commit comments

Comments
 (0)