OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [ipcp-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test that IPA-CP is able to figure out that poth parameters a are constant 7
2
   even though f and h recursively call each other and specialize them
3
   accordinly.  */
4
 
5
/* { dg-do compile } */
6
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
7
/* { dg-add-options bind_pic_locally } */
8
 
9
extern void use_stuff (int);
10
 
11
static
12
int g (int b, int c)
13
{
14
  int i;
15
 
16
  for (i = 0; i < b; i++)
17
    use_stuff (c);
18
}
19
 
20
static void f (int a, int x, int z);
21
 
22
static void h (int z, int a)
23
{
24
  use_stuff (z);
25
  f (a, 9, 10);
26
 
27
}
28
 
29
static void
30
f (int a, int x, int z)
31
{
32
  if (z > 1)
33
    g (a, x);
34
  else
35
    h (5, a);
36
}
37
 
38
int
39
main (int argc, char *argv[])
40
{
41
  int i;
42
  for (i = 0; i < 100; i++)
43
    f (7, 8, argc);
44
  return 0;
45
}
46
 
47
 
48
/* { dg-final { scan-ipa-dump "Creating a specialized node of f.*for all known contexts" "cp" } } */
49
/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp"  } } */
50
/* { dg-final { cleanup-ipa-dump "cp" } } */
51
 
52
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.