]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/pr82916.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr82916.c
CommitLineData
9e875fd8
JJ
1/* PR bootstrap/82916 */
2/* { dg-do run } */
3/* { dg-options "-O2 -fno-tree-dse" } */
4
5struct A { struct A *next; };
6struct C
7{
8 int *of;
9 struct C *parent, *prev, *next;
10 int depth;
11 int min;
12 struct C *min_occ;
13};
14
15__attribute__((noipa)) struct C *
16foo (int *node)
17{
18 struct A *p = __builtin_malloc (sizeof (struct C));
19 if (!p)
20 return 0;
21 p->next = 0;
22 /* Originally placement new. */
23 struct C *nw = (struct C *)(void *)p;
24 nw->of = node;
25 nw->parent = 0;
26 nw->prev = 0;
27 nw->next = 0;
28 nw->depth = 0;
29 nw->min_occ = nw;
30 nw->min = 0;
31 return nw;
32}
33
34int
35main ()
36{
37 int o;
38 struct C *p = foo (&o);
39 if (p)
40 {
41 if (p->of != &o || p->parent || p->prev || p->next || p->depth
42 || p->min || p->min_occ != p)
43 __builtin_abort ();
44 }
45 __builtin_free (p);
46 return 0;
47}