summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c
new file mode 100644
index 00000000000..eed21b367cc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+#include <math.h>
+void
+a8 (int n, int m, float *a, float *b, float *y, float *z)
+{
+ int i;
+#pragma omp parallel
+ {
+#pragma omp for nowait
+ for (i = 1; i < n; i++)
+ b[i] = (a[i] + a[i - 1]) / 2.0;
+#pragma omp for nowait
+ for (i = 0; i < m; i++)
+ y[i] = sqrt (z[i]);
+ }
+}