summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c
blob: 0f9b3438d3d3cdd667c36cb9472a3868a3b6c18d (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 link } */
/* { dg-options  "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis -fprint-escape-analysis" } */

#include <stddef.h>

struct astruct_s
{
  _Bool a;
  _Bool b;
  _Bool c;
};
struct astruct_s astruct[2];

int
main ()
{
  struct astruct_s another = astruct[0];
}

// This one is for the structure
/* { dg-final { scan-ipa-dump "collected:  record astruct_s .boolean_type a.boolean_type b.boolean_type c.." "type-escape-analysis" } } */
// This one is for the array. That's why it has two dots at the end. They correspond to []
/* { dg-final { scan-ipa-dump "collected:  record astruct_s .boolean_type a.boolean_type b.boolean_type c...." "type-escape-analysis" } } */