summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-22-rewrites-addr-expr-read-0.c
blob: 869d2b622e05723c3ba0b9b2d6875ad49edb362c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do run } */
/* { dg-options  "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis " } */

#include <assert.h>

int
main ()
{
  struct astruct_s
  {
    _Bool a;
    _Bool b;
    _Bool c;
  };
  struct astruct_s astruct;
  _Bool *a = &astruct.a;
  _Bool *c = &astruct.c;
  _Bool *c_1 = a + 1;
  _Bool *a_1 = c - 1;
  assert (c_1 == c);
  assert (a_1 == a);
  return 0;
}