summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-05-rewrite-local-decl-0.c
blob: 13aa56ed9ee6878310f64aaaf11e7902ece3af35 (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 <stdio.h>

int
main ()
{
  struct astruct_s
  {
    _Bool a;
    _Bool b;
    _Bool c;
  };
  struct astruct_s astruct;
  printf("%d %d\n", astruct.a, astruct.c);
  return 0;
}

// This is different from previous because here we are replacing a local declaration
/* { dg-final { scan-ipa-dump "replacing field a 0 with a 0" "type-escape-analysis" } } */
/* { dg-final { scan-ipa-dump "replacing field c 16 with c 8" "type-escape-analysis" } } */