]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.dwarf2/pieces-optimized-out.c
2bf9cf8e351a92e6b78081a3640927628e10a774
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / pieces-optimized-out.c
1 /* Copyright (C) 2013 Free Software Foundation, Inc.
2
3 This file is part of GDB.
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
7 the Free Software Foundation; either version 3 of the License, or
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.
14
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/>. */
17
18 /* This file is not actually compiled, the .S file is committed alongside
19 this file. The reason is that changes to the compiler might result
20 in different debug information being created, this could break the
21 test. */
22
23 struct str
24 {
25 int a;
26 int b;
27 int c : 3;
28 int d : 3;
29 };
30
31 int __attribute__ ((noinline))
32 foo (int arg)
33 {
34 return arg;
35 }
36
37 int
38 main ( void )
39 {
40 struct str s = {5, 7, 1, 2};
41 int v;
42
43 v = (s.a << 1);
44 v += foo (v);
45 return v + 5 + s.a;
46 }
47