aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l
diff options
context:
space:
mode:
authorIndu Bhagat <indu.bhagat@oracle.com>2023-12-10 22:08:03 -0800
committerIndu Bhagat <indu.bhagat@oracle.com>2024-05-31 17:07:47 -0700
commit163f1c3c1f395e9baa17c97fc7e2917d9e60fda3 (patch)
tree3eee0d7581d3bdf63479373249bb08dbeb3bdb6d /gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l
parent89828a28cdf9f7a72a70f1a874298a5e01f4dbbb (diff)
downloadgdb-users/ibhagat/try-scfi-aarch64-v2.zip
gdb-users/ibhagat/try-scfi-aarch64-v2.tar.gz
gdb-users/ibhagat/try-scfi-aarch64-v2.tar.bz2
gas: aarch64: testsuite: add new tests for SCFIusers/ibhagat/try-scfi-aarch64-v2
[Changes from V1] - new testcase scfi-cfg-4.s for the changes in cmp_scfi_state. - new testcase ginsn-arith-1.s for ginsn creation for various add sub insns. - removed redundant insns from ginsn-misc-1.s, some of those insns are now in ginsn-arith-1.s. [End of changes from V1] Similar to the x86_64 testcases, some .s files contain the corresponding CFI directives. This helps in validating the synthesized CFI by running those tests with and without the --scfi=experimental command line option. GAS issues some diagnostics, enabled by default, with --scfi=experimental. The diagnostics have been added with an intent to help user correct inadvertent errors in their hand-written asm. An error is issued when GAS finds that input asm is not amenable to accurate CFI synthesis. The existing scfi-diag-*.s tests in the gas/testsuite/gas/scfi/x86_64 directory test some SCFI diagnostics already: - (#1) "Warning: SCFI: Asymetrical register restore" - (#2) "Error: SCFI: usage of REG_FP as scratch not supported" - (#3) "Error: SCFI: unsupported stack manipulation pattern" - (#4) "Error: untraceable control flow for func 'XXX'" In the newly added aarch64 testsuite, further tests for additional diagnostics have been added: - scfi-diag-1.s in this patch highlights an aarch64-specific diagnostic: (#5) "Warning: SCFI: ignored probable save/restore op with reg offset" Additionally, some testcases are added to showcase the (currently) unsupported patterns, e.g., scfi-unsupported-1.s mov x16, 4384 sub sp, sp, x16 gas/testsuite/: * gas/scfi/README: Update comment to include aarch64. * gas/scfi/aarch64/scfi-aarch64.exp: New file. * gas/scfi/aarch64/ginsn-arith-1.l: New test. * gas/scfi/aarch64/ginsn-arith-1.s: New test. * gas/scfi/aarch64/ginsn-cofi-1.l: New test. * gas/scfi/aarch64/ginsn-cofi-1.s: New test. * gas/scfi/aarch64/ginsn-ldst-1.l: New test. * gas/scfi/aarch64/ginsn-ldst-1.s: New test. * gas/scfi/aarch64/scfi-cb-1.d: New test. * gas/scfi/aarch64/scfi-cb-1.l: New test. * gas/scfi/aarch64/scfi-cb-1.s: New test. * gas/scfi/aarch64/scfi-cfg-1.d: New test. * gas/scfi/aarch64/scfi-cfg-1.l: New test. * gas/scfi/aarch64/scfi-cfg-1.s: New test. * gas/scfi/aarch64/scfi-cfg-2.d: New test. * gas/scfi/aarch64/scfi-cfg-2.l: New test. * gas/scfi/aarch64/scfi-cfg-2.s: New test. * gas/scfi/aarch64/scfi-cfg-3.d: New test. * gas/scfi/aarch64/scfi-cfg-3.l: New test. * gas/scfi/aarch64/scfi-cfg-3.s: New test. * gas/scfi/aarch64/scfi-cfg-4.l: New test. * gas/scfi/aarch64/scfi-cfg-4.s: New test. * gas/scfi/aarch64/scfi-cond-br-1.d: New test. * gas/scfi/aarch64/scfi-cond-br-1.l: New test. * gas/scfi/aarch64/scfi-cond-br-1.s: New test. * gas/scfi/aarch64/scfi-diag-1.l: New test. * gas/scfi/aarch64/scfi-diag-1.s: New test. * gas/scfi/aarch64/scfi-diag-2.l: New test. * gas/scfi/aarch64/scfi-diag-2.s: New test. * gas/scfi/aarch64/scfi-ldrp-1.d: New test. * gas/scfi/aarch64/scfi-ldrp-1.l: New test. * gas/scfi/aarch64/scfi-ldrp-1.s: New test. * gas/scfi/aarch64/scfi-ldrp-2.d: New test. * gas/scfi/aarch64/scfi-ldrp-2.l: New test. * gas/scfi/aarch64/scfi-ldrp-2.s: New test. * gas/scfi/aarch64/scfi-strp-1.d: New test. * gas/scfi/aarch64/scfi-strp-1.l: New test. * gas/scfi/aarch64/scfi-strp-1.s: New test. * gas/scfi/aarch64/scfi-strp-2.d: New test. * gas/scfi/aarch64/scfi-strp-2.l: New test. * gas/scfi/aarch64/scfi-strp-2.s: New test. * gas/scfi/aarch64/scfi-unsupported-1.l: New test. * gas/scfi/aarch64/scfi-unsupported-1.s: New test.
Diffstat (limited to 'gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l')
-rw-r--r--gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l46
1 files changed, 46 insertions, 0 deletions
diff --git a/gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l b/gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l
new file mode 100644
index 0000000..511a2b0
--- /dev/null
+++ b/gas/testsuite/gas/scfi/aarch64/ginsn-ldst-1.l
@@ -0,0 +1,46 @@
+AARCH64 GAS .*
+
+ 1 # Testcase for a variety of ld st instructions
+ 2 .text
+ 3 .align 2
+ 4 .global foo
+ 5 .type foo, %function
+ 5 ginsn: SYM FUNC_BEGIN
+ 6 foo:
+ 6 ginsn: SYM foo
+ 7 # ldstpair_indexed
+ 8 0000 FF7F8629 stp wzr, wzr, \[sp, 48\]!
+ 8 ginsn: ADD %r31, 48, %r31
+ 9 0004 E00782A9 stp x0, x1, \[sp, 32\]!
+ 9 ginsn: ADD %r31, 32, %r31
+ 9 ginsn: STORE %r0, \[%r31\+0\]
+ 9 ginsn: STORE %r1, \[%r31\+8\]
+ 10 0008 E827BC6D stp d8, d9, \[sp, -64\]!
+ 10 ginsn: ADD %r31, -64, %r31
+ 11 000c E827C46C ldp d8, d9, \[sp\], 64
+ 11 ginsn: ADD %r31, 64, %r31
+ 12 # ldstpair_off
+ 13 0010 E00702AD stp q0, q1, \[sp, 64\]
+ 14 0014 FF7F0629 stp wzr, wzr, \[sp, 48\]
+ 15 0018 1F7840AD ldp q31, q30, \[x0\]
+ 16 # ldst_imm9
+ 17 001c E78F4F38 ldrb w7, \[sp, 248\]!
+ 17 ginsn: ADD %r31, 248, %r31
+ 17 ginsn: LOAD \[%r31\+0\], %r7
+ 18 0020 FD0FC33C ldr q29, \[sp, 48\]!
+ 18 ginsn: ADD %r31, 48, %r31
+ 19 0024 FF0F42B8 ldr wzr, \[sp, 32\]!
+ 19 ginsn: ADD %r31, 32, %r31
+ 20 0028 E30742F8 ldr x3, \[sp\], 32
+ 20 ginsn: LOAD \[%r31\+0\], %r3
+ 20 ginsn: ADD %r31, 32, %r31
+ 21 #ldst_pos
+ 22 002c FF3340B9 ldr wzr, \[sp, 48\]
+ 23 0030 FD1300F9 str x29, \[sp, 32\]
+ 23 ginsn: STORE %r29, \[%r31\+32\]
+ 24 0034 FD1340F9 ldr x29, \[sp, 32\]
+ 24 ginsn: LOAD \[%r31\+32\], %r29
+ 25 0038 C0035FD6 ret
+ 25 ginsn: RET
+ 26 .size foo, .-foo
+ 26 ginsn: SYM FUNC_END