OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR c++/41920
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.dg
/
20010912-1.c
1
/* { 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
}