summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c
blob: d646c8599e834f651ab6d306306a36ed139503f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* { 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;
};

void
record_parameter (struct astruct_s a)
{}
void
pointer_parameter (struct astruct_s *a)
{}
void
array_parameter (struct astruct_s a[])
{}

int
main ()
{}

// We have a complete type, probably from record_parameter
/* { dg-final { scan-wpa-ipa-dump "collected:  record astruct_s .boolean_type a.boolean_type b.boolean_type c.." "type-escape-analysis" } } */
// Now we have an incomplete struct
/* { dg-final { scan-wpa-ipa-dump "collected:  record astruct_s .." "type-escape-analysis" } } */
// This is the pointer...
/* { dg-final { scan-wpa-ipa-dump "collected:  record astruct_s ..." "type-escape-analysis" } } */
// We are missing the array parameter
// But it seems that the array parameter is passed as a pointer, which makes
// sense... array_parameter (struct astruct_s * a)
// {
//   <bb 2> :
//   return;
//
// }