summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c
blob: 58411202767a8c718641828716e62adac55072b2 (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
41
42
43
44
45
46
47
/* { dg-options "-O3 -fno-inline -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */

#include <stdlib.h>

struct S { int a; struct V *b; };
typedef struct { int c; } T;
typedef struct { int d; int e; } U;

void * 
fn (void *x) 
{
  return x;
}

int
foo (struct S *s)
{
  T x;
  
  T y = *(T *)fn (&x);
  return y.c;
}

int
bar (struct S *s)
{
  U x;
  
  U y = *(U *)fn (&x);
  return y.d + s->a;
}

int 
main ()
{
  struct S s;

  foo(&s) + bar (&s);

  return 0;
}

/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */