summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-46-static-0.c
blob: 636d8c6b5a057116ad55e90fdcfe653bd0e461f8 (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 <stddef.h>

struct a_s
{
  _Bool a;
  _Bool b;
  _Bool c;
};

struct a_s a_t;

int
main ()
{
  _Bool *a = &(a_t.a);
  _Bool *c = &(a_t.c);
  ptrdiff_t diff = c - a;
  assert (diff == 1);
}