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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [pure-const-2.c] - Blame information for rev 706

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-tree-optimized" } */
3
static __attribute__ ((noinline, noclone))
4
int i_am_pure(char *c, int n)
5
{
6
  char *d=__builtin_alloca (n);
7
  int i;
8
  int sum;
9
  for (i=0;i<n;i++)
10
    d[i] = c[i];
11
  for (i=0;i<n;i++)
12
    d[i] *= c[n-i];
13
  for (i=0;i<n;i++)
14
    sum+=d[i];
15
  if (sum)
16
    __builtin_unreachable ();
17
  return sum;
18
}
19
char array[11];
20
int
21
main(void)
22
{
23
  i_am_pure (array,5);
24
  i_am_pure (array,11);
25
  return 0;
26
}
27
/* { dg-final { scan-tree-dump "found to be pure: i_am_pure" "local-pure-const1"} } */
28
/* { dg-final { scan-tree-dump-not "i_am_pure" "optimized"} } */
29
/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
30
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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