summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/postincr-1.c
blob: 6aa203cb2ea982cd7bddd114c5051107471265e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Simple test for proper postincrement semantics.  */
/* { dg-do run } */

int i;
int c;
int *f ()
{
  ++c;
  return &i;
}

int main ()
{
  int r;
  r = (*f())++;
  if (!(r == 0 && i == 1 && c == 1))
    abort ();
  return 0;
}