1255767Sdes/* This testcase is part of GDB, the GNU debugger.
260573Skris
376262Sgreen   Copyright 2012-2020 Free Software Foundation, Inc.
465674Skris
565674Skris   This program is free software; you can redistribute it and/or modify
665674Skris   it under the terms of the GNU General Public License as published by
765674Skris   the Free Software Foundation; either version 3 of the License, or
865674Skris   (at your option) any later version.
965674Skris
1065674Skris   This program is distributed in the hope that it will be useful,
1165674Skris   but WITHOUT ANY WARRANTY; without even the implied warranty of
1265674Skris   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1365674Skris   GNU General Public License for more details.
1465674Skris
1565674Skris   You should have received a copy of the GNU General Public License
1665674Skris   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
1765674Skris
1865674Skrisint
1965674Skrisfoo (int i, int j)
2065674Skris{
2165674Skris  asm ("foo_label: .globl foo_label");
2265674Skris  return 0;
2365674Skris}
2460573Skris
2560573Skrisint
2660573Skrisbar (int i)
27162856Sdes{
2860573Skris  int j = 2;
29162856Sdes
30162856Sdes  asm ("bar_label: .globl bar_label");
31162856Sdes  return foo (i, j);
32162856Sdes}
33162856Sdes
34162856Sdesint global1 = 1;
35162856Sdesint global2 = 2;
36181111Sdes
37162856Sdesstatic void
38162856Sdesend (void)
39162856Sdes{}
40162856Sdes
4198941Sdesint
4298941Sdesmain (void)
4398941Sdes{
44126277Sdes  int ret = 0;
4598941Sdes
46126277Sdes  global1++;
4798941Sdes  global2++;
4892559Sdes  ret = bar (0);
4998941Sdes
50162856Sdes  end ();
51162856Sdes  return ret;
52162856Sdes}
53181111Sdes