]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/s390-tdbregs.c
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / s390-tdbregs.c
CommitLineData
618f726f 1/* Copyright 2008-2016 Free Software Foundation, Inc.
4ac33720
UW
2
3 This file is part of GDB.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18#include <stdio.h>
19
20static void
21my_tbegin ()
22{
23 __asm__ volatile
24 ( "1: .byte 0xe5,0x60,0x00,0x00,0xff,0x00\n"
25 " jnz 1b"
26 : /* no return value */
27 : /* no inputs */
28 : "cc", "memory" );
29}
30
31static void
32my_tend ()
33{
34 __asm__ volatile
35 ( " .byte 0xb2,0xf8,0x00,0x00"
36 : /* no return value */
37 : /* no inputs */
38 : "cc", "memory" );
39}
40
41void
42try_transaction (void)
43{
44 my_tbegin ();
45 my_tend ();
46}
47
48void
49crash_in_transaction (void)
50{
51 volatile char *p = 0;
52
53 my_tbegin ();
54 *p = 5; /* FAULT */
55 my_tend ();
56}
57
58int
59main (int argc, char *argv[])
60{
61 try_transaction ();
62 crash_in_transaction ();
63 return 0;
64}