Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: gdb/testsuite/gdb.arch/s390-tdbregs.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.arch/s390-multiarch.exp ('k') | gdb/testsuite/gdb.arch/s390-tdbregs.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.arch/s390-tdbregs.c
diff --git a/gdb/testsuite/gdb.arch/ppc-fp.c b/gdb/testsuite/gdb.arch/s390-tdbregs.c
similarity index 52%
copy from gdb/testsuite/gdb.arch/ppc-fp.c
copy to gdb/testsuite/gdb.arch/s390-tdbregs.c
index e6630d962fb293587c31e4bd76c4f1c049c4ce66..03c44346cd42b496206bc041caf48895472d8584 100644
--- a/gdb/testsuite/gdb.arch/ppc-fp.c
+++ b/gdb/testsuite/gdb.arch/s390-tdbregs.c
@@ -1,4 +1,4 @@
-/* Copyright 2008-2012 Free Software Foundation, Inc.
+/* Copyright 2008-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -15,22 +15,50 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-int
-main (int argc, char *argv[])
+#include <stdio.h>
+
+static void
+my_tbegin ()
{
- double result;
+ __asm__ volatile
+ ( "1: .byte 0xe5,0x60,0x00,0x00,0xff,0x00\n"
+ " jnz 1b"
+ : /* no return value */
+ : /* no inputs */
+ : "cc", "memory" );
+}
+
+static void
+my_tend ()
+{
+ __asm__ volatile
+ ( " .byte 0xb2,0xf8,0x00,0x00"
+ : /* no return value */
+ : /* no inputs */
+ : "cc", "memory" );
+}
- asm ("fdiv %0, %1, %1\n" /* Invalid operation. */
- : "=f" (result)
- : "f" (0.0));
+void
+try_transaction (void)
+{
+ my_tbegin ();
+ my_tend ();
+}
- asm ("mtfsf 0xff, %0\n" /* Reset FPSCR. */
- :
- : "f" (0.0));
+void
+crash_in_transaction (void)
+{
+ volatile char *p = 0;
- asm ("fdiv %0, %1, %2\n" /* Division by zero. */
- : "=f" (result)
- : "f" (1.25), "f" (0.0));
+ my_tbegin ();
+ *p = 5; /* FAULT */
+ my_tend ();
+}
+int
+main (int argc, char *argv[])
+{
+ try_transaction ();
+ crash_in_transaction ();
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.arch/s390-multiarch.exp ('k') | gdb/testsuite/gdb.arch/s390-tdbregs.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698