[binutils-gdb] s390: sframe: Test handling of .cfi_def_cfa_register

Jens Remus jremus@sourceware.org
Fri Jul 11 08:31:36 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e2dfd75e00b0d7cd65b5829872dd18c33f0f3089

commit e2dfd75e00b0d7cd65b5829872dd18c33f0f3089
Author: Jens Remus <jremus@linux.ibm.com>
Date:   Fri Jul 11 10:29:40 2025 +0200

    s390: sframe: Test handling of .cfi_def_cfa_register
    
    Port x86-64 test for handling of .cfi_def_cfa_register from commit
    3602da6fa285 ("gas: sframe: fix handling of .cfi_def_cfa_register")
    to s390x.
    
    gas/testsuite/
            PR gas/32879
            * gas/cfi-sframe/cfi-sframe.exp: Add new test for handling of
            .cfi_def_cfa_register on s390x.
            * gas/cfi-sframe/cfi-sframe-s390x-3.d: Likewise.
            * gas/cfi-sframe/cfi-sframe-s390x-3.s: Likewise.
    
    Bug: https://sourceware.org/PR32879
    Signed-off-by: Jens Remus <jremus@linux.ibm.com>

Diff:
---
 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.d | 19 +++++++++++++++++++
 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.s |  4 ++++
 gas/testsuite/gas/cfi-sframe/cfi-sframe.exp       |  1 +
 3 files changed, 24 insertions(+)

diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.d
new file mode 100644
index 00000000000..f775fe54ed7
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.d
@@ -0,0 +1,19 @@
+#name: SFrame generation on s390x - .cfi_def_cfa_register with no previous offset
+#as: --gsframe
+#objdump: --sframe=.sframe
+#...
+Contents of the SFrame section .sframe:
+
+  Header :
+
+    Version: SFRAME_VERSION_2
+    Flags: SFRAME_F_FDE_FUNC_START_PCREL
+    Num FDEs: 1
+    Num FREs: 1
+
+  Function Index :
+
+    func idx \[0\]: pc = 0x0, size = 0 bytes
+    STARTPC +CFA +FP +RA +
+    0+0000 +fp\+160 +u +u +
+#pass
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.s
new file mode 100644
index 00000000000..ea8c9e1ff13
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.s
@@ -0,0 +1,4 @@
+# Although not a useful construct by itself, ensure graceful handling.
+	.cfi_startproc
+	.cfi_def_cfa_register 11
+	.cfi_endproc
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
index b26ce60c6e5..9c5a16f255b 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
@@ -115,6 +115,7 @@ if { [istarget "aarch64*-*-*"] && [gas_sframe_check] } then {
 if { [istarget "s390x*-*-*"] && [gas_sframe_check] } then {
     run_dump_test "cfi-sframe-s390x-1"
     run_dump_test "cfi-sframe-s390x-2"
+    run_dump_test "cfi-sframe-s390x-3"
     run_dump_test "cfi-sframe-s390x-err-1"
     run_dump_test "cfi-sframe-s390x-err-2"
     run_dump_test "cfi-sframe-s390x-err-3"


More information about the Binutils-cvs mailing list