Debian Codegraph @

gcc/testsuite/gcc.dg/torture/pr70740-1.c

raw
1 /* { dg-do compile } */
2
3 /* This is an alternative to the original pr70740.c testcase,
4 arrays are now 1 in size where they were 0 in the other testcase. */
5
6 extern int foo (void);
7 extern void *memcpy (void *, const void *, __SIZE_TYPE__);
8
9 struct
10 {
11 char a[6];
12 } d;
13 struct
14 {
15 int a1[1];
16 int a2[1];
17 int a3[1];
18 int a4[1];
19 } a, c;
20 int b;
21
22 int *
23 bar ()
24 {
25 if (b)
26 return a.a4;
27 return a.a2;
28 }
29
30 void
31 baz ()
32 {
33 int *e, *f;
34 if (foo ())
35 e = c.a3;
36 else
37 e = c.a1;
38 memcpy (d.a, e, 6);
39 f = bar ();
40 memcpy (d.a, f, 1);
41 }