summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.ext/label1.C
blob: 8bf82ce7ab9fc7c7cab5a6d6c287d343102ebb4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do run  }
// { dg-options "" }
// Origin: Mark Mitchell <mark@codesourcery.com>

int main ()
{
  int i = 0;
  int j = 0;
  int k = 0;

 l:
  if (j)
    return 0;
  ({
    __label__ l; 
    k = 0;
  l: 
    if (++k <= 2)
      goto l;
    ++i;});
  if (i > 1 || k != 3)
    return 1;
  else
    {
      j = 1;
      goto l;
    }
}