(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
debug/
pr36690-2.c
       1  /* PR debug/36690 */
       2  /* Verify that breakpoint can be put on goto f1, it is hit and
       3     varz at that spot is defined and contains 5.  Nowhere else
       4     in the function should be varz in the scope.
       5     This version of the test just checks that it can be compiled, linked
       6     and executed, further testing is done in corresponding gcc.dg/dwarf2/
       7     test and hopefully in gdb testsuite.  */
       8  /* { dg-do run } */
       9  /* { dg-options "-O0 -g -dA" } */
      10  
      11  int cnt;
      12  
      13  void
      14  bar (int i)
      15  {
      16    cnt += i;
      17  }
      18  
      19  void
      20  foo (int i)
      21  {
      22    if (!i)
      23      bar (0);
      24    else
      25      {
      26        static int varz = 5;
      27        goto f1;
      28      }
      29    bar (1);
      30  f1:
      31    bar (2);
      32  }
      33  
      34  int
      35  main (void)
      36  {
      37    foo (0);
      38    foo (1);
      39    return 0;
      40  }