]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/call-sc.c
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / call-sc.c
CommitLineData
71d7dd7c
AC
1/* This testcase is part of GDB, the GNU debugger.
2
42a4f53d 3 Copyright 2004-2019 Free Software Foundation, Inc.
71d7dd7c
AC
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
a9762ec7 7 the Free Software Foundation; either version 3 of the License, or
71d7dd7c
AC
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.
a9762ec7 14
71d7dd7c 15 You should have received a copy of the GNU General Public License
a9762ec7 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
71d7dd7c
AC
17
18*/
19
20/* Useful abreviations. */
21typedef void t;
22typedef char tc;
23typedef short ts;
24typedef int ti;
25typedef long tl;
26typedef long long tll;
27typedef float tf;
28typedef double td;
29typedef long double tld;
30typedef enum { e = '1' } te;
31
32/* Force the type of each field. */
33#ifndef T
34typedef t T;
35#endif
36
37T foo = '1', L;
38
39T fun()
40{
41 return foo;
42}
43
71d7dd7c 44void Fun(T foo)
71d7dd7c
AC
45{
46 L = foo;
47}
48
a59add0c 49void zed ()
71d7dd7c
AC
50{
51 L = 'Z';
52}
53
54int main()
55{
71d7dd7c
AC
56 int i;
57
58 Fun(foo);
59
60 /* An infinite loop that first clears all the variables and then
61 calls the function. This "hack" is to make re-testing easier -
177b42fe 62 "advance fun" is guaranteed to have always been preceded by a
71d7dd7c
AC
63 global variable clearing zed call. */
64
65 zed ();
66 while (1)
67 {
68 L = fun ();
69 zed ();
70 }
71
72 return 0;
73}