[PATCH 7/57][Arm][GAS] Add support for MVE instructions: vstr/vldr
[binutils-gdb.git] / gdb / testsuite / gdb.base / nested-subp3.c
blob44ccef1d1adfc4ebe1781db4123d42f540974177
1 /* This test program is part of GDB, the GNU debugger.
3 Copyright 2015-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/>. */
18 #include <stdlib.h>
20 typedef void (*callback_t) (void);
22 extern void process (callback_t cb);
23 extern void parent (int first, callback_t cb);
25 void
26 ignore (int unused)
28 (void) unused;
31 void
32 process (callback_t cb)
34 parent (0, cb);
37 void
38 parent (int first, callback_t cb)
40 void child (void)
42 /* When reaching this, there are two block instances for PARENT on the
43 stack: the one that is right in the upper frame is not the one actually
44 used for non-local references, so GDB has to follow the static link in
45 order to get the correct instance, and thus in order to read the proper
46 variables.
48 As a simple check, we can verify that under GDB, the following is true:
49 parent_first == first (which should be one: see the IF block below). */
50 const int parent_first = first;
51 ignore (parent_first); /* STOP */
52 ignore (first);
55 if (first)
56 process (&child);
57 else
58 cb ();
61 int
62 main ()
64 parent (1, NULL);
65 return 0;