From: Jason Merrill Date: Wed, 18 Dec 2002 20:00:28 +0000 (-0500) Subject: new test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b197bc017286cbddb7ddbb071cbd79b6cee18e9c;p=gcc.git new test From-SVN: r60263 --- diff --git a/gcc/testsuite/gcc.dg/postincr-1.c b/gcc/testsuite/gcc.dg/postincr-1.c new file mode 100644 index 00000000000..6aa203cb2ea --- /dev/null +++ b/gcc/testsuite/gcc.dg/postincr-1.c @@ -0,0 +1,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; +}