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