Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/20171008-1.c

raw
1 struct S { char c1, c2, c3, c4; } __attribute__((aligned(4)));
2
3 static char bar (char **p) __attribute__((noclone, noinline));
4 static struct S foo (void) __attribute__((noclone, noinline));
5
6 int i;
7
8 static char
9 bar (char **p)
10 {
11 i = 1;
12 return 0;
13 }
14
15 static struct S
16 foo (void)
17 {
18 struct S ret;
19 char r, s, c1, c2;
20 char *p = &r;
21
22 s = bar (&p);
23 if (s)
24 c2 = *p;
25 c1 = 0;
26
27 ret.c1 = c1;
28 ret.c2 = c2;
29 return ret;
30 }
31
32 int main (void)
33 {
34 struct S s = foo ();
35 if (s.c1 != 0)
36 __builtin_abort ();
37 return 0;
38 }