OSDN Git Service

8f9751d22bf8e8e577e7afd4adee9da064b0d546
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / struct / wo_prof_empty_str.c
1 /* { dg-options "-O3 -fno-inline -fipa-type-escape -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
2 /* { dg-do compile } */
3 /* { dg-do run } */
4
5 #include <stdlib.h>
6
7 struct S { int a; struct V *b; };
8 typedef struct { int c; } T;
9 typedef struct { int d; int e; } U;
10
11 void * 
12 fn (void *x) 
13 {
14   return x;
15 }
16
17 int
18 foo (struct S *s)
19 {
20   T x;
21   
22   T y = *(T *)fn (&x);
23   return y.c;
24 }
25
26 int
27 bar (struct S *s)
28 {
29   U x;
30   
31   U y = *(U *)fn (&x);
32   return y.d + s->a;
33 }
34
35 int 
36 main ()
37 {
38   struct S s;
39
40   foo(&s) + bar (&s);
41
42   return 0;
43 }
44
45 /*--------------------------------------------------------------------------*/
46 /* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail { "avr-*-*" } } } } */
47 /* { dg-final { cleanup-ipa-dump "*" } } */