Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-inline-with-lexical-scope.c
CommitLineData
34dc0f95
TBA
1/* This testcase is part of GDB, the GNU debugger.
2
88b9d363 3 Copyright 2021-2022 Free Software Foundation, Inc.
34dc0f95
TBA
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
17 <http://www.gnu.org/licenses/>. */
18
19#ifdef __GNUC__
20#define ATTR __attribute__((always_inline))
21#else
22#define ATTR
23#endif
24
25int global_num = 0;
26int global_value = 0;
27
28inline ATTR
29static void
30func ()
31{ /* func prologue */
32 global_num = 42;
ca43e660 33 int num = 42;
34dc0f95
TBA
34 if (num > 2)
35 {
36 asm ("scope_label1: .globl scope_label1");
37 global_value = num;
38 int value = num;
39 asm ("breakpoint_label: .globl breakpoint_label");
ca43e660 40 global_value += value;
34dc0f95
TBA
41 asm ("scope_label2: .globl scope_label2");
42 }
43} /* func end */
44
45int
46main ()
47{ /* main prologue */
48 asm ("main_label: .globl main_label");
49 func (); /* func call */
50 asm ("main_label2: .globl main_label2");
51 return 0; /* main return */
52} /* main end */
This page took 0.062909 seconds and 4 git commands to generate.