annotate gcc/testsuite/gcc.dg/gnu89-init-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test whether __compound_literal.* objects are not emitted unless
kono
parents:
diff changeset
2 they are actually needed. */
kono
parents:
diff changeset
3 /* Origin: Jakub Jelinek <jakub@redhat.com> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "-std=gnu89 -O2" } */
kono
parents:
diff changeset
6 /* { dg-final { scan-assembler-not "__compound_literal" } } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct A { int i; int j; int k[4]; };
kono
parents:
diff changeset
9 struct B { };
kono
parents:
diff changeset
10 struct C { int i; };
kono
parents:
diff changeset
11 struct D { int i; struct C j; };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 struct A a = (struct A) { .j = 6, .k[2] = 12 };
kono
parents:
diff changeset
14 struct B b = (struct B) { };
kono
parents:
diff changeset
15 int c[] = (int []) { [2] = 6, 7, 8 };
kono
parents:
diff changeset
16 int d[] = (int [3]) { 1 };
kono
parents:
diff changeset
17 int e[2] = (int []) { 1, 2 };
kono
parents:
diff changeset
18 int f[2] = (int [2]) { 1 };
kono
parents:
diff changeset
19 struct C g[3] = { [2] = (struct C) { 13 }, [1] = (const struct C) { 12 } };
kono
parents:
diff changeset
20 struct D h = { .j = (struct C) { 15 }, .i = 14 };
kono
parents:
diff changeset
21 struct D i[2] = { [1].j = (const struct C) { 17 },
kono
parents:
diff changeset
22 [0] = { 0, (struct C) { 16 } } };
kono
parents:
diff changeset
23 static const int *j = 1 ? (const int *) 0 : & (const int) { 26 };
kono
parents:
diff changeset
24 int k = (int) sizeof ((int [6]) { 1, 2, 3, 4, 5, 6 }) + 4;
kono
parents:
diff changeset
25 int l = (int) sizeof ((struct C) { 16 });