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 middle-end/40692
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
20060929-1.c
1
/* PR c/29154 */
2
3
extern void abort (void);
4
5
void
6
foo (int **p, int *q)
7
{
8
*(*p++)++ = *q++;
9
}
10
11
void
12
bar (int **p, int *q)
13
{
14
**p = *q++;
15
*(*p++)++;
16
}
17
18
void
19
baz (int **p, int *q)
20
{
21
**p = *q++;
22
(*p++)++;
23
}
24
25
int
26
main (void)
27
{
28
int i = 42, j = 0;
29
int *p = &i;
30
foo (&p, &j);
31
if (p - 1 != &i || j != 0 || i != 0)
32
abort ();
33
i = 43;
34
p = &i;
35
bar (&p, &j);
36
if (p - 1 != &i || j != 0 || i != 0)
37
abort ();
38
i = 44;
39
p = &i;
40
baz (&p, &j);
41
if (p - 1 != &i || j != 0 || i != 0)
42
abort ();
43
return 0;
44
}