summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-33-pointer-indirection-level-0.c
blob: 0fc5f0f9e4675d93fee18329d50485c72d275550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do run } */
/* { dg-options  "-flto -flto-partition=none -fipa-dead-field-eliminate -fdump-ipa-structure-reorg -fipa-typelist-field=b -fipa-typelist-struct=astruct_s" } */

#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 = a_ptr + 1;
  _Bool *a_ptr_2 = &((*p1)->a);
  _Bool *c_ptr_2 = a_ptr_2 + 1;
  assert (c_ptr == c_ptr_2);
}