diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20171008-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20171008-1.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20171008-1.c b/gcc/testsuite/gcc.c-torture/execute/20171008-1.c new file mode 100644 index 0000000..cde807a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20171008-1.c @@ -0,0 +1,38 @@ +struct S { char c1, c2, c3, c4; } __attribute__((aligned(4))); + +static char bar (char **p) __attribute__((noclone, noinline)); +static struct S foo (void) __attribute__((noclone, noinline)); + +int i; + +static char +bar (char **p) +{ + i = 1; + return 0; +} + +static struct S +foo (void) +{ + struct S ret; + char r, s, c1, c2; + char *p = &r; + + s = bar (&p); + if (s) + c2 = *p; + c1 = 0; + + ret.c1 = c1; + ret.c2 = c2; + return ret; +} + +int main (void) +{ + struct S s = foo (); + if (s.c1 != 0) + __builtin_abort (); + return 0; +} |