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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [loop-12.c] - Blame information for rev 711

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

Line No. Rev Author Line
1 688 jeremybenn
/* Checks that pure functions are not treated as const.  */
2
 
3
char *p;
4
 
5
static int __attribute__ ((pure))
6
is_end_of_statement (void)
7
{
8
  return *p == '\n' || *p == ';' || *p == '!';
9
}
10
 
11
void foo (void)
12
{
13
  /* The is_end_of_statement call was moved out of the loop at one stage,
14
     resulting in an endless loop.  */
15
  while (!is_end_of_statement ())
16
    p++;
17
}
18
 
19
int
20
main (void)
21
{
22
  p = "abc\n";
23
  foo ();
24
  return 0;
25
}

powered by: WebSVN 2.1.0

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