blob: 9d0d2e03e8dd1a399fe5e973cc194d861ac20731 (
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 } */
/* { dg-options "-O2 -fpic" } */
/* { dg-warning "not supported" "PIC unsupported" { target cris-*-elf* cris-*-aout* mmix-*-* } 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);
}
|