libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-labels-3.c
blob2d75e34ab1bb0242d241baab3b716d1f1d69dbf6
1 /* Tests for labels before declarations and at ends of compound statements
2 * in combination with attributes. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c23 -Wall" } */
6 int f(void)
7 {
8 goto b;
9 a: int i = 0;
10 aa: __attribute__((unused)) int u = 0; int v = 0; /* { dg-warning "GNU-style attribute between label and declaration appertains to the label" } */
11 goto c;
12 { c: }
13 b: goto a;
14 return i + u + v;
15 d: __attribute__((unused)) (void)0;
16 e: __attribute__((unused))
19 int g(void)
21 goto b;
22 a: int i = 0;
23 [[maybe_unused]] aa: int u = 0; int v = 0;
24 goto c;
25 { c: }
26 b: goto a;
27 return i + u + v;
28 [[maybe_unused]] d: (void)0;
29 [[maybe_unused]] e:
32 void h(void)
34 [[maybe_unused]] a: [[maybe_unused]] b: [[maybe_unused]] int x;
36 if (1)
37 [[maybe_unused]] c: [[maybe_unused]] d: (void)0;