aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c/pr46886.c28
2 files changed, 33 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 8d9015d..daebf23 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46886
+ * testsuite/libgomp.c/pr46886.c: New testcase.
+
2012-01-25 Matthias Klose <doko@ubuntu.com>
* config/linux/arm: Remove empty directory.
diff --git a/libgomp/testsuite/libgomp.c/pr46886.c b/libgomp/testsuite/libgomp.c/pr46886.c
new file mode 100644
index 0000000..fbdc4e1
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr46886.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O -ftree-parallelize-loops=4 -fno-tree-ch -fno-tree-dominator-opts" } */
+
+void abort(void);
+
+int d[1024], e[1024];
+
+int foo (void)
+{
+ int s = 0;
+ int i;
+ for (i = 0; i < 1024; i++)
+ s += d[i] - e[i];
+ return s;
+}
+
+int main ()
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ d[i] = i * 2;
+ e[i] = i;
+ }
+ if (foo () != 1023 * 1024 / 2)
+ abort ();
+ return 0;
+}