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; |
} |