1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2017-2019 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
[2];
41 write_size8twice (void)
43 static const uint64_t first
= 1;
44 static const uint64_t second
= 2;
47 asm volatile ("stp %1, %2, [%0]"
49 : "r" (data
.u
.size8twice
), "r" (first
), "r" (second
) /* input */
50 : "memory" /* clobber */);
52 data
.u
.size8twice
[0] = first
;
53 data
.u
.size8twice
[1] = second
;
60 volatile uint64_t local
;
62 assert (sizeof (data
) == 8 + 2 * 8);
70 /* __s390x__ also defines __s390__ */
72 # define ACCESS(var) var = ~var
74 # define ACCESS(var) local = var
77 ACCESS (data
.u
.size8
[offset
]);
80 ACCESS (data
.u
.size4
[offset
]);
83 ACCESS (data
.u
.size2
[offset
]);
86 ACCESS (data
.u
.size1
[offset
]);
93 size
= size
; /* start_again */
95 return 0; /* final_return */