aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2022-12-22 09:57:52 -0800
committerIndu Bhagat <indu.bhagat@oracle.com>2022-12-22 09:57:52 -0800
commitd429702d9e9f109dd1c9841ce8a698dbd7a5ed06 (patch)
tree62a19841adb3be37c51efc369d48b2e7667ef5cc
parent95e829affb0a46394fd87048e7599ce950eabf5f (diff)
downloadgdb-d429702d9e9f109dd1c9841ce8a698dbd7a5ed06.zip
gdb-d429702d9e9f109dd1c9841ce8a698dbd7a5ed06.tar.gz
gdb-d429702d9e9f109dd1c9841ce8a698dbd7a5ed06.tar.bz2
gas: sframe: testsuite: add testcase for .cfi_b_key_frame
This is actually a composite test that checks SFrame unwind information generation for both the .cfi_negate_ra_state and .cfi_b_key_frame directives on aarch64. ChangeLog: * testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d: New test. * testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s: Likewise. * testsuite/gas/cfi-sframe/cfi-sframe.exp: Run new test.
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d27
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s36
-rw-r--r--gas/testsuite/gas/cfi-sframe/cfi-sframe.exp1
3 files changed, 64 insertions, 0 deletions
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d
new file mode 100644
index 0000000..666a941
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.d
@@ -0,0 +1,27 @@
+#as: --gsframe
+#objdump: --sframe=.sframe
+#name: SFrame cfi_b_key_frame and cfi_negate_ra_state composite test
+#...
+Contents of the SFrame section .sframe:
+
+ Header :
+
+ Version: SFRAME_VERSION_1
+ Flags: NONE
+ Num FDEs: 2
+ Num FREs: 6
+
+ Function Index :
+ func idx \[0\]: pc = 0x0, size = 12 bytes
+ STARTPC + CFA + FP + RA +
+ 0+0000 +sp\+0 +u +u +
+ 0+0004 +sp\+0 +u +u\[s\] +
+ 0+0008 +sp\+16 +c-16 +c-8\[s\] +
+
+ func idx \[1\]: pc = 0x0, size = 20 bytes, pauth = B key
+ STARTPC + CFA + FP + RA +
+ 0+0000 +sp\+0 +u +u +
+ 0+0004 +sp\+0 +u +u\[s\] +
+ 0+0008 +sp\+16 +c-16 +c-8\[s\] +
+
+#pass
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s
new file mode 100644
index 0000000..d9a408c
--- /dev/null
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-pac-ab-key-1.s
@@ -0,0 +1,36 @@
+## same as aarch64/pac_ab_key.s
+ .arch armv8-a
+ .text
+ .align 2
+ .global _Z5foo_av
+ .type _Z5foo_av, %function
+_Z5foo_av:
+.LFB0:
+ .cfi_startproc
+ hint 25 // paciasp
+ .cfi_window_save
+ stp x29, x30, [sp, -16]!
+ .cfi_def_cfa_offset 16
+ .cfi_offset 29, -16
+ .cfi_offset 30, -8
+ ret
+ .cfi_endproc
+.LFE0:
+ .size _Z5foo_av, .-_Z5foo_av
+ .align 2
+ .global _Z5foo_bv
+ .type _Z5foo_bv, %function
+_Z5foo_bv:
+.LFB1:
+ .cfi_startproc
+ .cfi_b_key_frame
+ hint 27 // pacibsp
+ .cfi_window_save
+ stp x29, x30, [sp, -16]!
+ .cfi_def_cfa_offset 16
+ .cfi_offset 29, -16
+ .cfi_offset 30, -8
+ nop
+ nop
+ ret
+ .cfi_endproc
diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
index f001fad..fa153fc 100644
--- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
+++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp
@@ -97,4 +97,5 @@ if { [istarget "x86_64-*-*"] && [gas_sframe_check] } then {
if { [istarget "aarch64*-*-*"] && [gas_sframe_check] } then {
run_dump_test "cfi-sframe-aarch64-1"
run_dump_test "cfi-sframe-aarch64-2"
+ run_dump_test "cfi-sframe-aarch64-pac-ab-key-1"
}