summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-10-array-0.c
blob: 1e84a46cfe27e7828f16f7e4021e3997d5e4e608 (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>
#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);
}