]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - libgomp/testsuite/libgomp.c++/loop-5.C
Imported gcc-4.4.3
[msp430-gcc.git] / libgomp / testsuite / libgomp.c++ / loop-5.C
diff --git a/libgomp/testsuite/libgomp.c++/loop-5.C b/libgomp/testsuite/libgomp.c++/loop-5.C
new file mode 100644 (file)
index 0000000..c427efa
--- /dev/null
@@ -0,0 +1,19 @@
+extern "C" void abort ();
+
+int check;
+int f1() { check |= 1; return 1; }
+int f2() { check |= 2; return 11; }
+int f3() { check |= 4; return 2; }
+
+int a[12];
+
+int main()
+{
+  #pragma omp for
+  for (int i = f1(); i <= f2(); i += f3())
+    a[i] = 1;
+
+  for (int i = 0; i < 12; ++i)
+    if (a[i] != (i & 1))
+      abort ();
+}