diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-31 11:08:32 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-31 11:09:47 +0200 |
commit | 3b2ffd32d2104afba04288687ed381bd65a53b25 (patch) | |
tree | c30f7bef358548101e1e91ed084076970575872c /sim/testsuite/bpf/ldabs.s | |
parent | 71ddc1cc0b8683955f628bee76405686bc44ffc6 (diff) | |
download | gdb-3b2ffd32d2104afba04288687ed381bd65a53b25.zip gdb-3b2ffd32d2104afba04288687ed381bd65a53b25.tar.gz gdb-3b2ffd32d2104afba04288687ed381bd65a53b25.tar.bz2 |
bpf: sim: do not overflow instruction immediates in tests
This patch fixes some instructions in the BPF tests that overflow the
signed immediates. Note that this happened to work before by chance,
as GAS would silently truncate.
Tested in bpf-unknown-none.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
Diffstat (limited to 'sim/testsuite/bpf/ldabs.s')
-rw-r--r-- | sim/testsuite/bpf/ldabs.s | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sim/testsuite/bpf/ldabs.s b/sim/testsuite/bpf/ldabs.s index ae777f1..f54b805 100644 --- a/sim/testsuite/bpf/ldabs.s +++ b/sim/testsuite/bpf/ldabs.s @@ -34,13 +34,13 @@ main: ;; Write the value 0x7eadbeef into memory at 0x2004 ;; i.e. offset 4 within the data buffer pointed to by ;; ((struct sk_buff *)r6)->data - stw [%r6+0x1004], 0xdeadbeef + stw [%r6+0x1004], 0x0eadbeef ;; Now load data[4] into r0 using the ldabsw instruction ldabsw 0x4 ;; ...and compare to what we expect - fail_ne32 %r0, 0xdeadbeef + fail_ne32 %r0, 0x0eadbeef ;; Repeat for a half-word (2-bytes) sth [%r6+0x1008], 0x1234 @@ -62,10 +62,10 @@ main: ;; Now, we do the same for the indirect loads mov %r7, 0x100 - stw [%r6+0x1100], 0xfeedbeef + stw [%r6+0x1100], 0x0eedbeef ldindw %r7, 0x0 - fail_ne32 %r0, 0xfeedbeef + fail_ne32 %r0, 0x0eedbeef ;; half-word sth [%r6+0x1104], 0x6789 |