summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/loop-14.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/loop-14.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/loop-14.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-14.c b/gcc/testsuite/gcc.c-torture/execute/loop-14.c
new file mode 100644
index 000000000..8c9929276
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-14.c
@@ -0,0 +1,20 @@
+int a3[3];
+
+void f(int *a)
+{
+ int i;
+
+ for (i=3; --i;)
+ a[i] = 42 / i;
+}
+
+int
+main ()
+{
+ f(a3);
+
+ if (a3[1] != 42 || a3[2] != 21)
+ abort ();
+
+ exit (0);
+}