Blame SOURCES/gdb-opcodes-clflushopt-test.patch

93189d
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
93189d
From: Fedora GDB patches <invalid@email.com>
93189d
Date: Fri, 27 Oct 2017 21:07:50 +0200
93189d
Subject: gdb-opcodes-clflushopt-test.patch
93189d
93189d
;; Test clflushopt instruction decode (for RH BZ 1262471).
93189d
;;=fedoratest
93189d
93189d
diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.S b/gdb/testsuite/gdb.arch/amd64-clflushopt.S
93189d
new file mode 100644
93189d
--- /dev/null
93189d
+++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.S
93189d
@@ -0,0 +1,19 @@
93189d
+/* Copyright 2016 Free Software Foundation, Inc.
93189d
+
93189d
+   This program is free software; you can redistribute it and/or modify
93189d
+   it under the terms of the GNU General Public License as published by
93189d
+   the Free Software Foundation; either version 3 of the License, or
93189d
+   (at your option) any later version.
93189d
+
93189d
+   This program is distributed in the hope that it will be useful,
93189d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
93189d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93189d
+   GNU General Public License for more details.
93189d
+
93189d
+   You should have received a copy of the GNU General Public License
93189d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
93189d
+
93189d
+   This file is part of the gdb testsuite.  */
93189d
+
93189d
+_start:	.globl	_start
93189d
+	clflushopt (%edi)
93189d
diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.exp b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp
93189d
new file mode 100644
93189d
--- /dev/null
93189d
+++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp
93189d
@@ -0,0 +1,25 @@
93189d
+# Copyright 2016 Free Software Foundation, Inc.
93189d
+
93189d
+# This program is free software; you can redistribute it and/or modify
93189d
+# it under the terms of the GNU General Public License as published by
93189d
+# the Free Software Foundation; either version 3 of the License, or
93189d
+# (at your option) any later version.
93189d
+#
93189d
+# This program is distributed in the hope that it will be useful,
93189d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
93189d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93189d
+# GNU General Public License for more details.
93189d
+#
93189d
+# You should have received a copy of the GNU General Public License
93189d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
93189d
+
93189d
+if { ![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"] } then {
93189d
+    verbose "Skipping amd64 clflushopt test."
93189d
+    return
93189d
+}
93189d
+
93189d
+if [prepare_for_testing amd64-clflushopt.exp amd64-clflushopt amd64-clflushopt.S [list debug "additional_flags=-nostdlib"]] {
93189d
+    return -1
93189d
+}
93189d
+
93189d
+gdb_test "disas _start" "Dump of assembler code for function _start:\r\n *0x\[0-9a-f\]+ <\[+\]0>:\tclflushopt \\(%edi\\)\r\nEnd of assembler dump\\." "clflushopt"