aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2020-08-07 20:40:01 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2020-08-07 20:40:01 +0200
commitaebda2fbcb92b7538ca240effae598338b5d9625 (patch)
tree659d9467282e11e8c705fd14a4a3e7eebb561f38
parentd844f10ac2735da8e5643236d7007a81098cbc2b (diff)
downloadgdb-aebda2fbcb92b7538ca240effae598338b5d9625.zip
gdb-aebda2fbcb92b7538ca240effae598338b5d9625.tar.gz
gdb-aebda2fbcb92b7538ca240effae598338b5d9625.tar.bz2
bpf: add missing tests from previous commits
2020-08-07 David Faust <david.faust@oracle.com> * testsuite/ld-bpf/call-3.s: New file. * testsuite/ld-bpf/call-3.d: Likewise.
-rw-r--r--ld/testsuite/ld-bpf/call-3.d19
-rw-r--r--ld/testsuite/ld-bpf/call-3.s12
2 files changed, 31 insertions, 0 deletions
diff --git a/ld/testsuite/ld-bpf/call-3.d b/ld/testsuite/ld-bpf/call-3.d
new file mode 100644
index 0000000..d371cd7
--- /dev/null
+++ b/ld/testsuite/ld-bpf/call-3.d
@@ -0,0 +1,19 @@
+#as: --EL
+#source: call-3.s
+#objdump: -dr
+#ld: -EL
+#name: CALL check unsigned underflow
+
+.*: +file format .*bpf.*
+
+Disassembly of section .text:
+
+[0-9a-f]+ <bar>:
+ *[0-9a-f]+: b7 00 00 00 00 00 00 00 mov %r0,0
+ *[0-9a-f]+: 95 00 00 00 00 00 00 00 exit
+
+[0-9a-f]+ <main>:
+ *[0-9a-f]+: b7 00 00 00 03 00 00 00 mov %r0,3
+ *[0-9a-f]+: b7 01 00 00 01 00 00 00 mov %r1,1
+ *[0-9a-f]+: 85 10 00 00 fb ff ff ff call -5
+ *[0-9a-f]+: 95 00 00 00 00 00 00 00 exit
diff --git a/ld/testsuite/ld-bpf/call-3.s b/ld/testsuite/ld-bpf/call-3.s
new file mode 100644
index 0000000..d4c042c
--- /dev/null
+++ b/ld/testsuite/ld-bpf/call-3.s
@@ -0,0 +1,12 @@
+ .text
+ .align 4
+ .global bar
+bar:
+ mov %r0, 0
+ exit
+
+main:
+ mov %r0, 3
+ mov %r1, 1
+ call bar
+ exit