1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2017-2024 Free Software Foundation, Inc.
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.
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.
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/>. */
23 static volatile struct
32 uint64_t size8twice
[3];
41 write_size8twice (void)
43 static const uint64_t first
= 1;
44 static const uint64_t second
= 2;
47 volatile void *p
= &data
.u
.size8twice
[offset
];
48 asm volatile ("stp %1, %2, [%0]"
50 : "r" (p
), "r" (first
), "r" (second
) /* input */
51 : "memory" /* clobber */);
53 data
.u
.size8twice
[offset
] = first
;
54 data
.u
.size8twice
[offset
+ 1] = second
;
61 volatile uint64_t local
;
63 assert (sizeof (data
) == 8 + 3 * 8);
71 /* __s390x__ also defines __s390__ */
73 # define ACCESS(var) var = ~var
75 # define ACCESS(var) local = var
78 ACCESS (data
.u
.size8
[offset
]);
81 ACCESS (data
.u
.size4
[offset
]);
84 ACCESS (data
.u
.size2
[offset
]);
87 ACCESS (data
.u
.size1
[offset
]);
94 size
= size
; /* start_again */
96 return 0; /* final_return */