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