(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
c2x-auto-2.c
       1  /* Test C2x auto.  Valid code, execution tests.  Based on auto-type-1.c.  */
       2  /* { dg-do run } */
       3  /* { dg-options "-std=c2x -pedantic-errors" } */
       4  /* { dg-require-effective-target alloca } */
       5  
       6  extern void abort (void);
       7  extern void exit (int);
       8  
       9  auto i = 1;
      10  extern int i;
      11  auto c = (char) 1;
      12  extern char c;
      13  static auto u = 10U;
      14  extern unsigned int u;
      15  const auto ll = 1LL;
      16  extern const long long ll;
      17  
      18  int
      19  main (void)
      20  {
      21    if (i != 1 || c != 1 || u != 10U)
      22      abort ();
      23    auto ai = i;
      24    int *aip = &ai;
      25    if (ai != 1)
      26      abort ();
      27    auto p = (int (*) [++i]) 0;
      28    if (i != 2)
      29      abort ();
      30    if (sizeof (*p) != 2 * sizeof (int))
      31      abort ();
      32    int vla[u][u];
      33    int (*vp)[u] = &vla[0];
      34    auto vpp = ++vp;
      35    if (vp != &vla[1])
      36      abort ();
      37    exit (0);
      38  }