1/* This testcase is part of GDB, the GNU debugger. 2 3 Copyright 2021-2023 Free Software Foundation, Inc. 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; 33 int num = 42; 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"); 40 global_value += value; 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 */ 53