summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.ext/label2.C
blob: 1ba67d096ce5dcbc043da55985e443334dfbd68e (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
29
30
31
32
33
34
35
// { dg-do run  }
// { dg-options "" }
// Origin: Mark Mitchell <mark@codesourcery.com>

template <class T>
int f ()
{
  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;
    }
}

int main ()
{
  return f<double>();
}