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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050125-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
/* Verify that the CALL sideeffect isn't optimized away.  */
2
/* Contributed by Greg Parker  25 Jan 2005  <gparker@apple.com> */
3
 
4
#include <stdlib.h>
5
#include <stdio.h>
6
 
7
struct parse {
8
  char *next;
9
  char *end;
10
  int error;
11
};
12
 
13
int seterr(struct parse *p, int err)
14
{
15
  p->error = err;
16
  return 0;
17
}
18
 
19
void bracket_empty(struct parse *p)
20
{
21
  if (((p->next < p->end) && (*p->next++) == ']')  ||  seterr(p, 7)) { }
22
}
23
 
24
int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
25
{
26
  struct parse p;
27
  p.next = p.end = (char *)0x12345;
28
 
29
  p.error = 0;
30
  bracket_empty(&p);
31
  if (p.error != 7)
32
    abort ();
33
 
34
  return 0;
35
}

powered by: WebSVN 2.1.0

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