new test
authorJason Merrill <jason@gcc.gnu.org>
Wed, 18 Dec 2002 20:00:28 +0000 (15:00 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 18 Dec 2002 20:00:28 +0000 (15:00 -0500)
From-SVN: r60263

gcc/testsuite/gcc.dg/postincr-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/postincr-1.c b/gcc/testsuite/gcc.dg/postincr-1.c
new file mode 100644 (file)
index 0000000..6aa203c
--- /dev/null
@@ -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;
+}