6d840d9980
PR middle-end/56217 * omp-low.c (use_pointer_for_field): Return false if lower_send_shared_vars doesn't generate any copy-out code. * g++.dg/gomp/pr56217.C: New test. * testsuite/libgomp.c++/pr56217.C: New test. From-SVN: r195796
37 lines
545 B
C
37 lines
545 B
C
// PR middle-end/56217
|
|
// { dg-do run }
|
|
// { dg-options "-std=c++0x" }
|
|
|
|
extern "C" void abort ();
|
|
|
|
template <typename T>
|
|
struct ptr {
|
|
T *p;
|
|
ptr () : p () {}
|
|
ptr (ptr &) = delete;
|
|
ptr (ptr &&o) : p(o) {}
|
|
operator T * () { return p; }
|
|
};
|
|
|
|
int a[6] = { 100, 101, 102, 103, 104, 105 };
|
|
|
|
static ptr<int>
|
|
f ()
|
|
{
|
|
ptr<int> pt;
|
|
#pragma omp task shared (pt)
|
|
pt.p = a + 2;
|
|
#pragma omp taskwait
|
|
return pt;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
ptr<int> pt;
|
|
#pragma omp parallel
|
|
#pragma omp single
|
|
if (f () != a + 2 || *f () != 102)
|
|
abort ();
|
|
}
|