diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c new file mode 100644 index 00000000000..1e84a46cfe2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-options " -flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ + +#include <assert.h> +#include <stdio.h> + +int +main () +{ + struct astruct_s + { + _Bool a; + _Bool b; + _Bool c; + }; + struct astruct_s a; + printf ("%d %d\n", a.a, a.c); + struct astruct_s b[2]; + a = b[0]; + _Bool *a_ptr = &a.a; + _Bool *c_ptr = &a.c; + assert (a_ptr + 1 == c_ptr); +} |