Fix file cache tunables documentation
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-attr-syntax-1.c
blob9bca2162a5a7284b33990f79526d345b2752b33d
1 /* Test C23 attribute syntax. Basic tests of valid uses of empty
2 attributes. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c23 -pedantic-errors" } */
6 [ [ ] ] [[]];
8 [[]] int [[]] a [[]] = 123;
10 int f([[]] int x [[]], [[]] long [[]], short [[]] *[[]] [3] [[]],
11 int [[]] (int)[[]], int (*)(int)[[]]) [[]] [[]];
13 int g [[]] [2] [[]] [3] [[]];
15 int *[[]] const *[[]] volatile *[[]] *const p;
17 int *[[]][[]] q = 0;
19 struct [[]] s;
20 union [[]][[]] u;
22 struct [[]] s2 { [[]] long [[]] *a[[]] [3] [[]] [4], b[[]]; };
24 union [[]] u2 { [[]] long [[]] *a[[]] [3] [[]] [4]; };
26 int z = sizeof (int [[]]);
28 enum [[]] { E1 [[]][[]], E2[[]][[]] = 3 };
29 enum [[]] e { E3 = 4, E4 [[]] };
31 void
32 func (void) [[]]
34 [[]] int var;
35 [[]] { }
36 [[]] switch (a) { [[]] case 1: [[]] case 2: [[]] default: [[]] var = 3; }
37 [[]] x : [[]] y: [[]] var = 1;
38 [[]];
39 int [[]] var2;
40 [[]] if (a) [[]] (void) 0; else [[]] (void) 1;
41 [[]] while (0) [[]] var = 2;
42 [[]] do [[]] var = 3; while (0);
43 for ([[]] int zz = 1; zz < 10; zz++)
45 [[]] var2 = 8;
46 [[]] continue;
47 [[]] break;
49 if (a) [[]] goto x;
50 [[]] return;
53 void func2 () [[]];
55 void func3 () [[]] { }