Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.ext/constructor.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 // { dg-options "" } | |
3 // Testcase for constructor expressions (GNU extension) | |
4 | |
5 struct Any { | |
6 int *type; | |
7 int *addr; | |
8 }; | |
9 | |
10 int i, j; | |
11 | |
12 main () { | |
13 struct Any *ap = (struct Any *) | |
14 __builtin_alloca (sizeof(struct Any)); | |
15 *ap = ((struct Any){ &i, &j }) ; | |
16 | |
17 if (ap->type != &i || ap->addr != &j) | |
18 return 1; | |
19 return 0; | |
20 } |