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

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