Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/vla-15.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 } |