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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20010912-1.c] - Blame information for rev 713

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run { target fpic } } */
2
/* { dg-options "-O2 -fpic" } */
3
 
4
extern void abort (void);
5
extern void exit (int);
6
 
7
int bar (int x, char **y)
8
{
9
  if (x != 56)
10
    abort ();
11
  if (**y != 'a')
12
    abort ();
13
  *y = "def";
14
  return 1;
15
}
16
 
17
int baz (int x, char **y)
18
{
19
  if (x != 56)
20
    abort ();
21
  if (**y != 'a')
22
    abort ();
23
  return 26;
24
}
25
 
26
int foo (int x, char *y)
27
{
28
  int a;
29
  char *b = y;
30
  a = bar (x, &y);
31
  if (a)
32
    {
33
      y = b;
34
      a = baz (x, &y);
35
    }
36
  if (a)
37
    return a;
38
 
39
  baz (x, &y);
40
  return 0;
41
}
42
 
43
int main ()
44
{
45
  if (foo (56, "abc") != 26)
46
    abort ();
47
  exit (0);
48
}

powered by: WebSVN 2.1.0

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