Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.arch / aarch64-mops-watchpoint.c
blobb981f033d21098574505a9c136828e62204f455e
1 /* This test program is part of GDB, the GNU debugger.
3 Copyright 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/>. */
18 int
19 main (void)
21 char source[40] __attribute__ ((aligned (8)))
22 = "This is a relatively long string...";
23 char a[40] __attribute__ ((aligned (8)))
24 = "String to be overwritten with zeroes";
25 char b[40] __attribute__ ((aligned (8)))
26 = "Another string to be memcopied...";
27 char c[40] __attribute__ ((aligned (8)))
28 = "Another string to be memmoved...";
29 char *p, *q;
30 long size, zero;
32 /* Break here. */
33 p = a;
34 size = sizeof (a);
35 zero = 0;
36 /* memset implemented in MOPS instructions. */
37 __asm__ volatile ("setp [%0]!, %1!, %2\n\t"
38 "setm [%0]!, %1!, %2\n\t"
39 "sete [%0]!, %1!, %2\n\t"
40 : "+&r"(p), "+&r"(size)
41 : "r"(zero)
42 : "memory");
44 p = b;
45 q = source;
46 size = sizeof (b);
47 /* memmove implemented in MOPS instructions. */
48 __asm__ volatile ("cpyp [%0]!, [%1]!, %2!\n\t"
49 "cpym [%0]!, [%1]!, %2!\n\t"
50 "cpye [%0]!, [%1]!, %2!\n\t"
51 : "+&r" (p), "+&r" (q), "+&r" (size)
53 : "memory");
54 p = c;
55 q = source;
56 size = sizeof (c);
57 /* memcpy implemented in MOPS instructions. */
58 __asm__ volatile ("cpyfp [%0]!, [%1]!, %2!\n\t"
59 "cpyfm [%0]!, [%1]!, %2!\n\t"
60 "cpyfe [%0]!, [%1]!, %2!\n\t"
61 : "+&r" (p), "+&r" (q), "+&r" (size)
63 : "memory");
65 return 0;