summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
blob: bf0714902a6e4bcf77974738702382b881c8c79f (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
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized" } */

struct a {int a,b;};
struct a make_me_big (int a);
struct a split_me (int a)
{
  struct a retval;
  if (__builtin_expect (a!=0,1))
    {
      retval.a = 0;
      retval.b = 0;
      return retval;
    }
  else
    {
      struct a retval = make_me_big (a);
      retval = make_me_big (a);
      retval = make_me_big (a);
      retval = make_me_big (a);
      retval = make_me_big (a);
      retval = make_me_big (a);
      return retval;
    }
}
int val;
test()
{
  split_me (val);
  split_me (val);
  split_me (val);
  split_me (val);
}
/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
/* { dg-final { cleanup-tree-dump "fnsplit" } } */
/* { dg-final { scan-tree-dump "part" "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */