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

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