aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu99-named-loops-1.c
blob: cb1c690ac15b6f314315aacd5a037f608db8be06 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* N3355 - Named loops.  */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -Wpedantic" } */

void
foo (int w)
{
  d: e: f:;
  a: b: c:
  for (int x = 0; x < 32; ++x)
    {
      if (x == 0)
	continue a;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (x == 1)
	continue b;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (x == 2)
	continue c;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (x == 31)
	break b;	/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    }
  int y = 0;
  g: h:
  #pragma GCC unroll 2
  while (y < 16)
    {
      ++y;
      if (y == 12)
	continue g;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (y == 13)
	continue h;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (y == 14)
	break g;	/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    }
  i: j:;
  k: l:
  switch (y)
    {
    case 6:
      break;
    case 7:
      break k;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    case 8:
      break l;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    }
  m: n: o: p:
  for (int x = 0; x < 2; ++x)
    q: r: s: t:
    switch (x)
      {
      case 0:
	u: v:
      case 3:
	w: x:
	for (int y = 0; y < 2; ++y)
	  y: z:
	  for (int z = 0; z < 2; ++z)
	    aa: ab: ac:
	    for (int a = 0; a < 2; ++a)
	      ad: ae: af:
	      switch (a)
		{
		case 0:
		  if (w == 0)
		    break ae;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 1)
		    break ab;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 2)
		    break z;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 3)
		    break v;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 4)
		    break s;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 5)
		    break p;		/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		  else if (w == 6)
		    break;
		  else if (w == 7)
		    continue aa;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
		  else if (w == 8)
		    continue y;		/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
		  else if (w == 9)
		    continue x;		/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
		  else if (w == 10)
		    continue m;		/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
		  ag: ah:
		  do
		    {
		      if (w == 11)
			break ag;	/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
		      else
			continue ah;	/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
		    }
		  while (0);
		  break;
		default:
		  break;
		}
	break;
      default:
	break;
      }
  [[]] [[]] ai:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]] [[]] aj:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]] [[]] ak:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]] [[]] [[]]			/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  for (int x = 0; x < 32; ++x)
    if (x == 31)
      break ak;				/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    else if (x == 30)
      break aj;				/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    else if (x == 29)
      continue ai;			/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
  al:
  [[]] am:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]]					/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  do
    {
      if (w == 42)
	continue am;			/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
      else if (w == 41)
	break al;			/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    }
  while (1);
  an:
  [[]] ao:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]] [[]]				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  while (w)
    {
      if (w == 40)
	break ao;			/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
      else if (w == 39)
	continue an;			/* { dg-warning "ISO C does not support 'continue' statement with an identifier operand before" } */
    }
  [[]] ap:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]] aq:				/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  [[]]					/* { dg-warning "ISO C does not support '\\\[\\\[\\\]\\\]' attributes before C23" } */
  switch (w)
    {
    case 42:
      break ap;				/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    default:
      break aq;				/* { dg-warning "ISO C does not support 'break' statement with an identifier operand before" } */
    }
}