|
|
7bc85d |
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
|
7bc85d |
From: Fedora GDB patches <invalid@email.com>
|
|
|
7bc85d |
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
|
7bc85d |
Subject: gdb-6.6-bz230000-power6-disassembly-test.patch
|
|
|
7bc85d |
|
|
|
7bc85d |
;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
|
|
7bc85d |
;;=fedoratest
|
|
|
7bc85d |
|
|
|
7bc85d |
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
|
|
|
7bc85d |
|
|
|
7bc85d |
The original testcase
|
|
|
7bc85d |
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1
|
|
|
7bc85d |
requires too recent GCC.
|
|
|
7bc85d |
|
|
|
7bc85d |
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp
|
|
|
7bc85d |
new file mode 100644
|
|
|
7bc85d |
--- /dev/null
|
|
|
7bc85d |
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp
|
|
|
7bc85d |
@@ -0,0 +1,54 @@
|
|
|
7bc85d |
+# Copyright 2007 Free Software Foundation, Inc.
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+# This program is free software; you can redistribute it and/or modify
|
|
|
7bc85d |
+# it under the terms of the GNU General Public License as published by
|
|
|
7bc85d |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
7bc85d |
+# (at your option) any later version.
|
|
|
7bc85d |
+#
|
|
|
7bc85d |
+# This program is distributed in the hope that it will be useful,
|
|
|
7bc85d |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
7bc85d |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
7bc85d |
+# GNU General Public License for more details.
|
|
|
7bc85d |
+#
|
|
|
7bc85d |
+# You should have received a copy of the GNU General Public License
|
|
|
7bc85d |
+# along with this program; if not, write to the Free Software
|
|
|
7bc85d |
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+# Test PowerPC Power6 instructions disassembly.
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+if {![istarget "powerpc*-*-*"]} then {
|
|
|
7bc85d |
+ verbose "Skipping PowerPC Power6 instructions disassembly."
|
|
|
7bc85d |
+ return
|
|
|
7bc85d |
+}
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+set testfile "powerpc-power6"
|
|
|
7bc85d |
+set srcfile ${testfile}.s
|
|
|
7bc85d |
+set objfile [standard_output_file ${testfile}.o]
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
|
|
|
7bc85d |
+ untested "PowerPC prologue tests"
|
|
|
7bc85d |
+ return -1
|
|
|
7bc85d |
+}
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+gdb_exit
|
|
|
7bc85d |
+gdb_start
|
|
|
7bc85d |
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
7bc85d |
+gdb_load ${objfile}
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+# Disassemble the function.
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+gdb_test "disass func" ":\tblr\r\n.*" "Basic disassembly"
|
|
|
7bc85d |
+
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdcbzl *r8,r9\r\n.*" "Power5 disassembly dcbzl"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tfrsqrtes *f10,f11\r\n.*" "Power5 disassembly frsqrtes"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdadd *f1,f2,f1\r\n.*" "Power6 disassembly dadd"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdaddq *f0,f2,f0\r\n.*" "Power6 disassembly daddq"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdsub *f1,f2,f1\r\n.*" "Power6 disassembly dsub"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdsubq *f0,f2,f0\r\n.*" "Power6 disassembly dsubq"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdmul *f1,f2,f1\r\n.*" "Power6 disassembly dmul"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdmulq *f0,f2,f0\r\n.*" "Power6 disassembly dmulq"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tddiv *f1,f2,f1\r\n.*" "Power6 disassembly ddiv"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tddivq *f0,f2,f0\r\n.*" "Power6 disassembly ddivq"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdcmpu *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu"
|
|
|
7bc85d |
+gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq"
|
|
|
7bc85d |
diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s
|
|
|
7bc85d |
new file mode 100644
|
|
|
7bc85d |
--- /dev/null
|
|
|
7bc85d |
+++ b/gdb/testsuite/gdb.arch/powerpc-power6.s
|
|
|
7bc85d |
@@ -0,0 +1,16 @@
|
|
|
7bc85d |
+ .text
|
|
|
7bc85d |
+ .globl func
|
|
|
7bc85d |
+func:
|
|
|
7bc85d |
+ blr
|
|
|
7bc85d |
+ .long 0x7c284fec /* dcbzl r8,r9 */
|
|
|
7bc85d |
+ .long 0xed405834 /* frsqrtes f10,f11 */
|
|
|
7bc85d |
+ .long 0xec220804 /* dadd f1,f2,f1 */
|
|
|
7bc85d |
+ .long 0xfc020004 /* daddq f0,f2,f0 */
|
|
|
7bc85d |
+ .long 0xec220c04 /* dsub f1,f2,f1 */
|
|
|
7bc85d |
+ .long 0xfc020404 /* dsubq f0,f2,f0 */
|
|
|
7bc85d |
+ .long 0xec220844 /* dmul f1,f2,f1 */
|
|
|
7bc85d |
+ .long 0xfc020044 /* dmulq f0,f2,f0 */
|
|
|
7bc85d |
+ .long 0xec220c44 /* ddiv f1,f2,f1 */
|
|
|
7bc85d |
+ .long 0xfc020444 /* ddivq f0,f2,f0 */
|
|
|
7bc85d |
+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */
|
|
|
7bc85d |
+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */
|