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

#include <assert.h>

int
main ()
{
  struct astruct_s
  {
    int a;
    int b;
    int c;
    int d;
  };
  struct astruct_s astruct;
  int *a = &(astruct.a);
  int *c = &(astruct.c);
  int *d = &(astruct.d);
  assert (c - 1 == a);
  assert (a + 2 == d);
}