omp-builtins.def (BUILT_IN_GOMP_LOOP_NONMONOTONIC_RUNTIME_START, [...]): Fix up funct...
authorJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Dec 2018 22:47:55 +0000 (23:47 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Dec 2018 22:47:55 +0000 (23:47 +0100)
* omp-builtins.def (BUILT_IN_GOMP_LOOP_NONMONOTONIC_RUNTIME_START,
BUILT_IN_GOMP_LOOP_MAYBE_NONMONOTONIC_RUNTIME_START,
BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_RUNTIME_START,
BUILT_IN_GOMP_LOOP_ULL_MAYBE_NONMONOTONIC_RUNTIME_START,
BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_RUNTIME,
BUILT_IN_GOMP_PARALLEL_LOOP_MAYBE_NONMONOTONIC_RUNTIME): Fix up
function types - remove one argument.

* testsuite/libgomp.c-c++-common/for-16.c: New test.

From-SVN: r267067

gcc/ChangeLog
gcc/omp-builtins.def
libgomp/ChangeLog
libgomp/testsuite/libgomp.c-c++-common/for-16.c [new file with mode: 0644]

index 02be9cfe908b0fe8928d91310045367ab1e186e6..bce500dcdde10362781b857ba9e0f0468dad4403 100644 (file)
@@ -1,3 +1,14 @@
+2018-12-12  Tom de Vries  <tdevries@suse.de>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       * omp-builtins.def (BUILT_IN_GOMP_LOOP_NONMONOTONIC_RUNTIME_START,
+       BUILT_IN_GOMP_LOOP_MAYBE_NONMONOTONIC_RUNTIME_START,
+       BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_RUNTIME_START,
+       BUILT_IN_GOMP_LOOP_ULL_MAYBE_NONMONOTONIC_RUNTIME_START,
+       BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_RUNTIME,
+       BUILT_IN_GOMP_PARALLEL_LOOP_MAYBE_NONMONOTONIC_RUNTIME): Fix up
+       function types - remove one argument.
+
 2018-12-12  Martin Sebor  <msebor@redhat.com>
 
        * doc/extend.texi (attribute copy): Fix typos.
index 70051635fa0ac4b71af4ee659a976e3a5c337d88..187268097bcac465ca8ecbe2f2598e0496d8a38f 100644 (file)
@@ -126,11 +126,11 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_START,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_NONMONOTONIC_RUNTIME_START,
                  "GOMP_loop_nonmonotonic_runtime_start",
-                 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
+                 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_MAYBE_NONMONOTONIC_RUNTIME_START,
                  "GOMP_loop_maybe_nonmonotonic_runtime_start",
-                 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
+                 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
                  "GOMP_loop_ordered_static_start",
@@ -234,11 +234,11 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_START,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_RUNTIME_START,
                  "GOMP_loop_ull_nonmonotonic_runtime_start",
-                 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
+                 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_MAYBE_NONMONOTONIC_RUNTIME_START,
                  "GOMP_loop_ull_maybe_nonmonotonic_runtime_start",
-                 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
+                 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
                  ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_START,
                  "GOMP_loop_ull_ordered_static_start",
@@ -349,11 +349,11 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_GUIDED,
                  ATTR_NOTHROW_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_RUNTIME,
                  "GOMP_parallel_loop_nonmonotonic_runtime",
-                 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
+                 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
                  ATTR_NOTHROW_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_MAYBE_NONMONOTONIC_RUNTIME,
                  "GOMP_parallel_loop_maybe_nonmonotonic_runtime",
-                 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
+                 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
                  ATTR_NOTHROW_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END, "GOMP_loop_end",
                  BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
index 06d94648b7e9e02d77e7036902f53fa261b4c033..b8f508f05ab65f72016cc161f9bf463531247161 100644 (file)
@@ -1,3 +1,7 @@
+2018-12-12  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.c-c++-common/for-16.c: New test.
+
 2018-12-12  Andreas Schwab  <schwab@suse.de>
 
        * config/linux/ia64/futex.h (sys_futex0): Don't mark r12 as
diff --git a/libgomp/testsuite/libgomp.c-c++-common/for-16.c b/libgomp/testsuite/libgomp.c-c++-common/for-16.c
new file mode 100644 (file)
index 0000000..5649ba9
--- /dev/null
@@ -0,0 +1,114 @@
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void abort (void);
+
+unsigned long long int k = 16;
+#pragma omp declare target to (k)
+
+int
+main ()
+{
+  unsigned char a[144], b[144], c[144];
+  int l;
+  #pragma omp target map(from:a, b, c)
+  {
+    int i;
+    unsigned long long int j;
+    #pragma omp parallel for schedule (runtime)
+    for (i = 0; i < 16; i++)
+      a[i] = i;
+    #pragma omp parallel for schedule (monotonic: runtime)
+    for (i = 0; i < 16; i++)
+      a[i + 16] = i + 16;
+    #pragma omp parallel for schedule (nonmonotonic: runtime)
+    for (i = 0; i < 16; i++)
+      a[i + 32] = i + 32;
+    #pragma omp parallel
+    {
+      #pragma omp for schedule (runtime)
+      for (i = 0; i < 16; i++)
+        a[i + 48] = i + 48;
+      #pragma omp for schedule (monotonic: runtime)
+      for (i = 0; i < 16; i++)
+        a[i + 64] = i + 64;
+      #pragma omp for schedule (nonmonotonic: runtime)
+      for (i = 0; i < 16; i++)
+        a[i + 80] = i + 80;
+      #pragma omp for schedule (runtime)
+      for (j = 0; j < k; j++)
+        a[j + 96] = j + 96;
+      #pragma omp for schedule (monotonic: runtime)
+      for (j = 0; j < k; j++)
+        a[j + 112] = j + 112;
+      #pragma omp for schedule (nonmonotonic: runtime)
+      for (j = 0; j < k; j++)
+        a[j + 128] = j + 128;
+    }
+    #pragma omp parallel for schedule (dynamic)
+    for (i = 0; i < 16; i++)
+      b[i] = i;
+    #pragma omp parallel for schedule (monotonic: dynamic)
+    for (i = 0; i < 16; i++)
+      b[i + 16] = i + 16;
+    #pragma omp parallel for schedule (nonmonotonic: dynamic)
+    for (i = 0; i < 16; i++)
+      b[i + 32] = i + 32;
+    #pragma omp parallel
+    {
+      #pragma omp for schedule (dynamic)
+      for (i = 0; i < 16; i++)
+        b[i + 48] = i + 48;
+      #pragma omp for schedule (monotonic: dynamic)
+      for (i = 0; i < 16; i++)
+        b[i + 64] = i + 64;
+      #pragma omp for schedule (nonmonotonic: dynamic)
+      for (i = 0; i < 16; i++)
+        b[i + 80] = i + 80;
+      #pragma omp for schedule (dynamic)
+      for (j = 0; j < k; j++)
+        b[j + 96] = j + 96;
+      #pragma omp for schedule (monotonic: dynamic)
+      for (j = 0; j < k; j++)
+        b[j + 112] = j + 112;
+      #pragma omp for schedule (nonmonotonic: dynamic)
+      for (j = 0; j < k; j++)
+        b[j + 128] = j + 128;
+    }
+    #pragma omp parallel for schedule (guided)
+    for (i = 0; i < 16; i++)
+      c[i] = i;
+    #pragma omp parallel for schedule (monotonic: guided)
+    for (i = 0; i < 16; i++)
+      c[i + 16] = i + 16;
+    #pragma omp parallel for schedule (nonmonotonic: guided)
+    for (i = 0; i < 16; i++)
+      c[i + 32] = i + 32;
+    #pragma omp parallel
+    {
+      #pragma omp for schedule (guided)
+      for (i = 0; i < 16; i++)
+        c[i + 48] = i + 48;
+      #pragma omp for schedule (monotonic: guided)
+      for (i = 0; i < 16; i++)
+        c[i + 64] = i + 64;
+      #pragma omp for schedule (nonmonotonic: guided)
+      for (i = 0; i < 16; i++)
+        c[i + 80] = i + 80;
+      #pragma omp for schedule (guided)
+      for (j = 0; j < k; j++)
+        c[j + 96] = j + 96;
+      #pragma omp for schedule (monotonic: guided)
+      for (j = 0; j < k; j++)
+        c[j + 112] = j + 112;
+      #pragma omp for schedule (nonmonotonic: guided)
+      for (j = 0; j < k; j++)
+        c[j + 128] = j + 128;
+    }
+  }
+  for (l = 0; l < 144; ++l)
+    if (a[l] != l || b[l] != l || c[l] != l)
+      abort ();
+  return 0;
+}