aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-04-26 10:35:51 +0200
committerJan Beulich <jbeulich@suse.com>2021-04-26 10:35:51 +0200
commitb818855549013ba43e730e07f790e5cbfd16a757 (patch)
treeae5d65b7fb1359fbceeca9d6f44dab75065d27ab /gas/testsuite
parentc290cb01face96fa9c2a4f96f7d57083da3c99f1 (diff)
downloadgdb-b818855549013ba43e730e07f790e5cbfd16a757.zip
gdb-b818855549013ba43e730e07f790e5cbfd16a757.tar.gz
gdb-b818855549013ba43e730e07f790e5cbfd16a757.tar.bz2
x86-64: have value properly checked when resolving fixup
Constants not known at the time an individual insn gets assembled and going into a sign-extended field still shouldn't be silently truncated at the time the respective fixup gets resolved.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/x86-64-addr32-bad.l29
-rw-r--r--gas/testsuite/gas/i386/x86-64-addr32-bad.s15
3 files changed, 45 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index e1dab45..a9a2a64 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -750,6 +750,7 @@ if [gas_64_check] then {
run_dump_test "x86_64-intel"
run_dump_test "x86-64-addr32"
run_dump_test "x86-64-addr32-intel"
+ run_list_test "x86-64-addr32-bad" "-al"
run_dump_test "x86-64-opcode"
run_dump_test "x86-64-intel64"
if { ! [istarget "*-*-*cygwin*"] && ![istarget "*-*-mingw*"] } then {
diff --git a/gas/testsuite/gas/i386/x86-64-addr32-bad.l b/gas/testsuite/gas/i386/x86-64-addr32-bad.l
new file mode 100644
index 0000000..bddf0d1
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-addr32-bad.l
@@ -0,0 +1,29 @@
+.*: Assembler messages:
+.*:3: Error:.* [0x]*88888888 .*
+.*:7: Error:.* [0x]*99999999 .*
+.*:11: Error:.* [0x]*99999999 .*
+GAS LISTING .*
+
+
+[ ]*[0-9]+[ ]+\.text
+[ ]*[0-9]+[ ]+addr32:
+[ ]*[0-9]+[ ]+lea 0x88888888\(%rax\), %rax
+[ ]*[0-9]+[ ]+\?\?\?\? 8D808888[ ]+lea 0x88888888\(%rax\), %eax
+[ ]*[0-9]+[ ]+8888
+[ ]*[0-9]+[ ]+\?\?\?\? 67488D80[ ]+lea 0x88888888\(%eax\), %rax
+[ ]*[0-9]+[ ]+88888888 *
+[ ]*[0-9]+[ ]*
+[ ]*[0-9]+[ ]+\?\?\?\? 488D8099[ ]+lea value\(%rax\), %rax
+[ ]*[0-9]+[ ]+999999
+[ ]*[0-9]+[ ]+\?\?\?\? 8D809999[ ]+lea value\(%rax\), %eax
+[ ]*[0-9]+[ ]+9999
+[ ]*[0-9]+[ ]+\?\?\?\? 67488D80[ ]+lea value\(%eax\), %rax
+[ ]*[0-9]+[ ]+99999999 *
+[ ]*[0-9]+[ ]*
+[ ]*[0-9]+[ ]+\?\?\?\? 48C7C099[ ]+mov \$value, %rax
+[ ]*[0-9]+[ ]+999999
+[ ]*[0-9]+[ ]+\?\?\?\? B8999999[ ]+mov \$value, %eax
+[ ]*[0-9]+[ ]+99
+[ ]*[0-9]+[ ]*
+[ ]*[0-9]+[ ]+\.equ value, 0x99999999
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-addr32-bad.s b/gas/testsuite/gas/i386/x86-64-addr32-bad.s
new file mode 100644
index 0000000..460be20
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-addr32-bad.s
@@ -0,0 +1,15 @@
+ .text
+addr32:
+ lea 0x88888888(%rax), %rax
+ lea 0x88888888(%rax), %eax
+ lea 0x88888888(%eax), %rax
+
+ lea value(%rax), %rax
+ lea value(%rax), %eax
+ lea value(%eax), %rax
+
+ mov $value, %rax
+ mov $value, %eax
+
+ .equ value, 0x99999999
+ .end