@@ -1,5 +1,8 @@
2015-07-22 Thomas Schwinge <thomas@codesourcery.com>
+ * oacc-init.c (acc_shutdown): Call gomp_init_targets_once.
+ * testsuite/libgomp.oacc-c-c++-common/lib-8.c: New file.
+
* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Resolve XFAIL.
2015-07-21 James Norris <jnorris@codesourcery.com>
@@ -461,6 +461,8 @@ ialias (acc_init)
void
acc_shutdown (acc_device_t d)
{
+ gomp_init_targets_once ();
+
gomp_mutex_lock (&acc_device_lock);
acc_shutdown_1 (d);
new file mode 100644
@@ -0,0 +1,16 @@
+/* Expect error message when shutting down a device that has never been
+ initialized. */
+/* { dg-do run } */
+
+#include <openacc.h>
+
+int
+main (int argc, char **argv)
+{
+ acc_shutdown (acc_device_default);
+
+ return 0;
+}
+
+/* { dg-output "no device initialized" } */
+/* { dg-shouldfail "" } */