Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/c-c++-common/vla-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Test that changes to a variable are reflected in a VLA later in the |
2 expression. */ | |
3 /* { dg-options "" } */ | |
4 | |
5 #ifdef __cplusplus | |
6 extern "C" | |
7 #endif | |
8 void abort(); | |
9 | |
10 int i = 4; | |
11 int f() | |
12 { | |
13 return i; | |
14 } | |
15 | |
16 int main() | |
17 { | |
18 if (i+=2, sizeof(*(int(*)[f()])0) != 6*sizeof(int)) | |
19 abort(); | |
20 return 0; | |
21 } |