xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.dwarf2/dw2-inline-header-lbls.c (revision 2dd295436a0082eb4f8d294f4aa73c223413d0f2)
1 /* Copyright 2020 Free Software Foundation, Inc.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 3 of the License, or
6    (at your option) any later version.
7 
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12 
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
15 
16 /* Used to insert labels with which we can build a fake line table.  */
17 #define LL(N) asm ("line_label_" #N ": .globl line_label_" #N)
18 
19 volatile int var;
20 volatile int bar;
21 
22 /* Generate some code to take up some space.  */
23 #define FILLER do { \
24     var = 99;	    \
25 } while (0)
26 
27 int
28 main ()
29 {					/* main prologue */
30   asm ("main_label: .globl main_label");
31   LL (1);	// F1, Ln 16
32   FILLER;
33   LL (2);	// F1, Ln 17
34   FILLER;
35   LL (3);	// F2, Ln 21
36   FILLER;
37   LL (4);	// F2, Ln 22 // F1, Ln 18, !S
38   FILLER;
39   LL (5);	// F1, Ln 19 !S
40   FILLER;
41   LL (6);	// F1, Ln 20
42   FILLER;
43   LL (7);
44   FILLER;
45   return 0;				/* main end */
46 }
47