]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Missing pr104517.c change from: 'Add a restriction on allocate clause (OpenMP 5.0)'
authorTobias Burnus <tobias@codesourcery.com>
Mon, 24 Oct 2022 08:53:36 +0000 (10:53 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 24 Oct 2022 08:53:36 +0000 (10:53 +0200)
OG12 commit df47c25110474565f521508a1545232550052a75 included everything
of r13-150-g1a8c4d9ed36556a95bd7d53c04d2ec4c95594061 but the change to
gcc/testsuite/gcc.dg/gomp/pr104517.c

This commit cherry-picks the missing changes to that file.
Note: The OG12 commit already contained the ChangeLog.omp entry for
that file.

gcc/testsuite/
* gcc.dg/gomp/pr104517.c: Update.

(cherry picked from commit 1a8c4d9ed36556a95bd7d53c04d2ec4c95594061)

gcc/testsuite/gcc.dg/gomp/pr104517.c

index efb3175beb3dd6a7102545efbc35e2ebdfa181f5..7e3bd1a1d1e141b7d7d037421e6a2acb02d76f4b 100644 (file)
@@ -2,11 +2,13 @@
 /* { dg-do compile } */
 /* { dg-options "-O1 -fcompare-debug -fopenmp -fno-tree-ter -save-temps" } */
 
-enum {
-  omp_default_mem_alloc,
-  omp_large_cap_mem_alloc,
-  omp_const_mem_alloc,
-  omp_high_bw_mem_alloc
+typedef enum omp_allocator_handle_t
+{
+  omp_null_allocator = 0,
+  omp_default_mem_alloc = 1,
+  omp_large_cap_mem_alloc = 2,
+  omp_const_mem_alloc = 3,
+  omp_high_bw_mem_alloc = 4,
 } omp_allocator_handle_t;
 
 int t, bar_nte, bar_tl, bar_i3, bar_dd;
@@ -23,7 +25,7 @@ bar (int *idp, int s, int nth, int g, int nta, int fi, int pp, int *q,
   int p = 0, i2 = 0, i1 = 0, m = 0, d = 0;
 
 #pragma omp target parallel for                               \
-  device(p) firstprivate (f) allocate (f) in_reduction(+:r2)
+  device(p) firstprivate (f) allocate (omp_default_mem_alloc:f) in_reduction(+:r2)
   for (int i = 0; i < 4; i++)
     ll++;
 
@@ -31,8 +33,8 @@ bar (int *idp, int s, int nth, int g, int nta, int fi, int pp, int *q,
   device(d) map (m)                                                     \
   if (target: p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
   if (parallel: i2) reduction(+:r) num_threads (nth) linear (ll)        \
-  schedule(static) collapse(1) nowait depend(inout: d) allocate (f)     \
-  in_reduction(+:r2)
+  schedule(static) collapse(1) nowait depend(inout: d) \
+  allocate (omp_default_mem_alloc:f) in_reduction(+:r2)
   for (int i = 0; i < 4; i++)
     ll++;