2016-02-26 Keith McDaniel <k.allen.mcdaniel@gmail.com>
Martin Jambor <mjambor@suse.cz>
* testsuite/lib/libgomp.exp
(check_effective_target_offload_device_shared_as): New proc.
* testsuite/libgomp.c++/declare_target-1.C: New test.
Co-Authored-By: Martin Jambor <mjambor@suse.cz>
From-SVN: r233757
+2016-02-26 Keith McDaniel <k.allen.mcdaniel@gmail.com>
+ Martin Jambor <mjambor@suse.cz>
+
+ * testsuite/lib/libgomp.exp
+ (check_effective_target_offload_device_shared_as): New proc.
+ * testsuite/libgomp.c++/declare_target-1.C: New test.
+
2016-02-25 Ilya Verbin <ilya.verbin@intel.com>
PR driver/68463
}
} ]
}
+
+# Return 1 if offload device is available and it has shared address space.
+proc check_effective_target_offload_device_shared_as { } {
+ return [check_runtime_nocache offload_device_shared_as {
+ int main ()
+ {
+ int x = 10;
+ #pragma omp target map(to: x)
+ x++;
+ return x == 10;
+ }
+ } ]
+}
# Return 1 if at least one nvidia board is present.
--- /dev/null
+// { dg-do run }
+// { dg-require-effective-target offload_device_shared_as }
+
+#include <stdlib.h>
+
+struct typeX
+{
+ int a;
+};
+
+class typeY
+{
+public:
+ int foo () { return a^0x01; }
+ int a;
+};
+
+#pragma omp declare target
+struct typeX varX;
+class typeY varY;
+#pragma omp end declare target
+
+int main ()
+{
+ varX.a = 0;
+ varY.a = 0;
+
+ #pragma omp target
+ {
+ varX.a = 100;
+ varY.a = 100;
+ }
+
+ if (varX.a != 100 || varY.a != 100)
+ abort ();
+
+ return 0;
+}