diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c new file mode 100644 index 00000000000..e91f8b7b5ec --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis -Wno-dfa -fipa-dlo-tests " } */ + +#include <assert.h> + +int +main () +{ + struct astruct_s + { + _Bool a; + _Bool b; + _Bool c; + _Bool d; + }; + struct astruct_s astruct; + struct astruct_s *p0 = &astruct; + struct astruct_s **p1 = &p0; + _Bool *a_ptr = &(astruct.a); + _Bool *c_ptr = &(astruct.c); + _Bool *c_ptr_from_1 = a_ptr + 1; + _Bool *a_ptr_2 = &((*p1)->a); + _Bool *c_ptr_from_2 = a_ptr_2 + 1; + assert (c_ptr == c_ptr_from_1); + assert (c_ptr == c_ptr_from_2); +} |