comparison gcc/testsuite/gcc.dg/vla-15.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900 (2017-10-27)
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Test for VLA size evaluation in sizeof typeof. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do run } */
4 /* { dg-options "-std=gnu99" } */
5
6 #include <stdarg.h>
7
8 extern void exit (int);
9 extern void abort (void);
10
11 char a[1];
12
13 void
14 f1 (void)
15 {
16 int i = 0;
17 int j = sizeof (typeof (*(++i, (char (*)[i])a)));
18 if (i != 1 || j != 1)
19 abort ();
20 }
21
22 int
23 main (void)
24 {
25 f1 ();
26 exit (0);
27 }