]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
s390: sframe: Test handling of .cfi_def_cfa_register
authorJens Remus <jremus@linux.ibm.com>
Fri, 11 Jul 2025 08:29:40 +0000 (10:29 +0200)
committerJens Remus <jremus@linux.ibm.com>
Fri, 11 Jul 2025 08:29:40 +0000 (10:29 +0200)
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>
gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-s390x-3.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp

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 (file)
index 0000000..f775fe5
--- /dev/null
@@ -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 (file)
index 0000000..ea8c9e1
--- /dev/null
@@ -0,0 +1,4 @@
+# Although not a useful construct by itself, ensure graceful handling.
+       .cfi_startproc
+       .cfi_def_cfa_register 11
+       .cfi_endproc
index b26ce60c6e597e24c77912337b182c46fb422df0..9c5a16f255b469922dd8f9cc66d4516bc257efeb 100644 (file)
@@ -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"