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

extern void abort (void);

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;
}