gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / 20010912-1.c
blobf41f698745fb478e942331474d02a7831bd080dd
1 /* { 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 } */
5 extern void abort (void);
6 extern void exit (int);
8 int bar (int x, char **y)
10 if (x != 56)
11 abort ();
12 if (**y != 'a')
13 abort ();
14 *y = "def";
15 return 1;
18 int baz (int x, char **y)
20 if (x != 56)
21 abort ();
22 if (**y != 'a')
23 abort ();
24 return 26;
27 int foo (int x, char *y)
29 int a;
30 char *b = y;
31 a = bar (x, &y);
32 if (a)
34 y = b;
35 a = baz (x, &y);
37 if (a)
38 return a;
40 baz (x, &y);
41 return 0;
44 int main ()
46 if (foo (56, "abc") != 26)
47 abort ();
48 exit (0);