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