[llvm] [X86] Update tailcc-ssp.ll assertions using update_llc_test_checks.py (PR #143500)
Omair Javaid via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 02:47:10 PDT 2025
https://github.com/omjavaid updated https://github.com/llvm/llvm-project/pull/143500
>From 75b5e975eda4d52d3cfe6631a5ea6ba076e98599 Mon Sep 17 00:00:00 2001
From: Muhammad Omair Javaid <omair.javaid at linaro.org>
Date: Tue, 10 Jun 2025 14:21:16 +0500
Subject: [PATCH] [X86] Update tailcc-ssp.ll assertions
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.
---
llvm/test/CodeGen/X86/tailcc-ssp.ll | 55 ++++++++++++++++++++++-------
1 file changed, 43 insertions(+), 12 deletions(-)
diff --git a/llvm/test/CodeGen/X86/tailcc-ssp.ll b/llvm/test/CodeGen/X86/tailcc-ssp.ll
index 5211e4fe9eef9..7ea5dd49f0242 100644
--- a/llvm/test/CodeGen/X86/tailcc-ssp.ll
+++ b/llvm/test/CodeGen/X86/tailcc-ssp.ll
@@ -78,7 +78,7 @@ define void @tailcall_unrelated_frame() sspreq {
; WINDOWS-NEXT: callq __security_check_cookie
; WINDOWS-NEXT: int3
; WINDOWS-NEXT: .seh_endproc
-
+;
; LINUX-LABEL: tailcall_unrelated_frame:
; LINUX: # %bb.0:
; LINUX-NEXT: pushq %rax
@@ -97,6 +97,7 @@ define void @tailcall_unrelated_frame() sspreq {
; LINUX-NEXT: .cfi_def_cfa_offset 16
; LINUX-NEXT: callq __stack_chk_fail at PLT
+
call void @bar()
tail call void @bar()
ret void
@@ -105,18 +106,48 @@ define void @tailcall_unrelated_frame() sspreq {
declare void @callee()
define void @caller() sspreq {
; WINDOWS-LABEL: caller:
-; WINDOWS: callq callee
-; WINDOWS: callq callee
-; WINDOWS: cmpq __security_cookie(%rip), %rcx
-; WINDOWS: jne
-; WINDOWS: callq __security_check_cookie
-
+; WINDOWS: # %bb.0:
+; WINDOWS-NEXT: subq $40, %rsp
+; WINDOWS-NEXT: .seh_stackalloc 40
+; WINDOWS-NEXT: .seh_endprologue
+; WINDOWS-NEXT: movq __security_cookie(%rip), %rax
+; WINDOWS-NEXT: xorq %rsp, %rax
+; WINDOWS-NEXT: movq %rax, {{[0-9]+}}(%rsp)
+; WINDOWS-NEXT: callq callee
+; WINDOWS-NEXT: callq callee
+; WINDOWS-NEXT: movq {{[0-9]+}}(%rsp), %rcx
+; WINDOWS-NEXT: xorq %rsp, %rcx
+; WINDOWS-NEXT: cmpq __security_cookie(%rip), %rcx
+; WINDOWS-NEXT: jne .LBB2_2
+; WINDOWS-NEXT: # %bb.1:
+; WINDOWS-NEXT: .seh_startepilogue
+; WINDOWS-NEXT: addq $40, %rsp
+; WINDOWS-NEXT: .seh_endepilogue
+; WINDOWS-NEXT: retq
+; WINDOWS-NEXT: .LBB2_2:
+; WINDOWS-NEXT: callq __security_check_cookie
+; WINDOWS-NEXT: int3
+; WINDOWS-NEXT: .seh_endproc
+;
; LINUX-LABEL: caller:
-; LINUX: callq callee at PLT
-; LINUX: callq callee at PLT
-; LINUX: cmpq
-; LINUX: jne
-; LINUX: callq __stack_chk_fail at PLT
+; LINUX: # %bb.0:
+; LINUX-NEXT: pushq %rax
+; LINUX-NEXT: .cfi_def_cfa_offset 16
+; LINUX-NEXT: movq %fs:40, %rax
+; LINUX-NEXT: movq %rax, (%rsp)
+; LINUX-NEXT: callq callee at PLT
+; LINUX-NEXT: callq callee at PLT
+; LINUX-NEXT: movq %fs:40, %rax
+; LINUX-NEXT: cmpq (%rsp), %rax
+; LINUX-NEXT: jne .LBB2_2
+; LINUX-NEXT: # %bb.1: # %SP_return
+; LINUX-NEXT: popq %rax
+; LINUX-NEXT: .cfi_def_cfa_offset 8
+; LINUX-NEXT: retq
+; LINUX-NEXT: .LBB2_2: # %CallStackCheckFailBlk
+; LINUX-NEXT: .cfi_def_cfa_offset 16
+; LINUX-NEXT: callq __stack_chk_fail at PLT
+
tail call void @callee()
call void @callee()
More information about the llvm-commits
mailing list