Debian Codegraph @

gcc/testsuite/gcc.dg/auto-type-1.c

raw
1 /* Test __auto_type. Test correct uses. */
2 /* { dg-do run } */
3 /* { dg-options "" } */
4
5 extern void abort (void);
6 extern void exit (int);
7
8 __auto_type i = 1;
9 extern int i;
10 __auto_type c = (char) 1;
11 extern char c;
12 static __auto_type u = 10U;
13 extern unsigned int u;
14 const __auto_type ll = 1LL;
15 extern const long long ll;
16
17 int
18 main (void)
19 {
20 if (i != 1 || c != 1 || u != 10U)
21 abort ();
22 __auto_type ai = i;
23 int *aip = &ai;
24 if (ai != 1)
25 abort ();
26 __auto_type p = (int (*) [++i]) 0;
27 if (i != 2)
28 abort ();
29 if (sizeof (*p) != 2 * sizeof (int))
30 abort ();
31 int vla[u][u];
32 int (*vp)[u] = &vla[0];
33 __auto_type vpp = ++vp;
34 if (vp != &vla[1])
35 abort ();
36 exit (0);
37 }