diff gcc/testsuite/c-c++-common/gomp/pr70550-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/c-c++-common/gomp/pr70550-2.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,55 @@
+/* PR middle-end/70550 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Wuninitialized" } */
+
+void bar (int);
+
+void
+foo (void)
+{
+  int i, j, k, l, m, n, o, p, q;
+  #pragma omp task				/* { dg-bogus "is used uninitialized in this function" } */
+  {
+    i = 2;
+    bar (i);
+  }
+  #pragma omp taskloop				/* { dg-bogus "is used uninitialized in this function" } */
+  for (j = 0; j < 10; j++)
+    {
+      k = 7;
+      bar (k);
+    }
+  #pragma omp task firstprivate (l)		/* { dg-warning "is used uninitialized in this function" } */
+  {
+    l = 2;
+    bar (l);
+  }
+  #pragma omp taskloop firstprivate (m)		/* { dg-warning "is used uninitialized in this function" } */
+  for (j = 0; j < 10; j++)
+    {
+      m = 7;
+      bar (m);
+    }
+  #pragma omp task shared (n)			/* { dg-bogus "is used uninitialized in this function" } */
+  {
+    n = 2;
+    bar (n);
+  }
+  #pragma omp taskloop shared (o)		/* { dg-bogus "is used uninitialized in this function" } */
+  for (j = 0; j < 10; j++)
+    {
+      o = 7;
+      bar (o);
+    }
+  #pragma omp task private (p)			/* { dg-bogus "is used uninitialized in this function" } */
+  {
+    p = 2;
+    bar (p);
+  }
+  #pragma omp taskloop shared (q)		/* { dg-bogus "is used uninitialized in this function" } */
+  for (j = 0; j < 10; j++)
+    {
+      q = 7;
+      bar (q);
+    }
+}