aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2y-if-decls-6.c
blob: 57dd9e01bde022793570970d9c3266e7426baa9e (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
/* N3356 - if declarations.  */
/* PR c/117019 */
/* { dg-do run } */
/* { dg-options "-std=c2y -Wall -Wextra" } */
/* Test VLAs.  */

void foo (int) { }

int
main ()
{
  int i = 3;

  if (int arr[i] = { }; !arr[0])
    foo (arr[0]);
  else
    __builtin_abort ();

  switch (int arr[i] = { }; arr[0])
    {
    case 0:
      foo (arr[0]);
      break;
    default:
      __builtin_abort ();
    }
}