annotate gcc/testsuite/gcc.dg/torture/pr93946-1.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 /* { dg-do run } */
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 union U { long long i; long f; };
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 struct a {union U u;};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 struct aa {struct a a;};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 struct b {union U u;};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 struct bb {struct b b;};
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9 long __attribute__((noipa))
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 foo (struct bb *bv, void *ptr)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 struct aa *a = ptr;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 struct bb *b = ptr;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 bv->b.u.f = 1;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 a->a.u.i = 0;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 b->b.u.f = 0;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17 return bv->b.u.f;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18 }
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 int
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21 main ()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
22 {
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
23 union C {struct aa aa; struct bb bb;} v;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
24 if (foo (&v.bb, &v) != 0)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
25 __builtin_abort ();
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
26 return 0;
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
27 }