Blame SOURCES/gdb-6.6-bz230000-power6-disassembly-test.patch

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