]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/enum_cond.c
c0fe8f547ef33bfa3fa502698f0891b56bb5511f
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / enum_cond.c
1 /* This testcase is part of GDB, the GNU debugger.
2 Copyright 2012-2017 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
16
17 enum EE
18 {
19 VALUE = 1
20 };
21
22 struct x
23 {
24 unsigned char before;
25 enum EE e;
26 unsigned char after;
27 };
28
29
30 int
31 call_me (struct x param)
32 {
33 return param.e;
34 }
35
36 int
37 main (void)
38 {
39 struct x val;
40
41 val.before = 0xff;
42 val.e = VALUE;
43 val.after = 0xff;
44
45 call_me (val);
46 return 0;
47 }
48