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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20010912-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run { target fpic } } */
2
/* { dg-options "-O2 -fpic" } */
3
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
int bar (int x, char **y)
9
{
10
  if (x != 56)
11
    abort ();
12
  if (**y != 'a')
13
    abort ();
14
  *y = "def";
15
  return 1;
16
}
17
 
18
int baz (int x, char **y)
19
{
20
  if (x != 56)
21
    abort ();
22
  if (**y != 'a')
23
    abort ();
24
  return 26;
25
}
26
 
27
int foo (int x, char *y)
28
{
29
  int a;
30
  char *b = y;
31
  a = bar (x, &y);
32
  if (a)
33
    {
34
      y = b;
35
      a = baz (x, &y);
36
    }
37
  if (a)
38
    return a;
39
 
40
  baz (x, &y);
41
  return 0;
42
}
43
 
44
int main ()
45
{
46
  if (foo (56, "abc") != 26)
47
    abort ();
48
  exit (0);
49
}

powered by: WebSVN 2.1.0

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