[committed,nvptx,testsuite,openacc,libgomp] Add insufficient-resources.c

Message ID 20190111114824.GA25400@delia
State New
Headers show
Series
  • [committed,nvptx,testsuite,openacc,libgomp] Add insufficient-resources.c
Related show

Commit Message

Tom de Vries Jan. 11, 2019, 11:48 a.m.
Hi,

Add a test-case that tests the "insufficient resources" fatal in the nvptx
libgomp plugin.

Committed to trunk.

Thanks,
- Tom

[nvptx, testsuite, openacc, libgomp] Add insufficient-resources.c

2019-01-11  Tom de Vries  <tdevries@suse.de>

	* testsuite/libgomp.oacc-c-c++-common/insufficient-resources.c: New
	test.

---
 .../insufficient-resources.c                        | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Patch

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/insufficient-resources.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/insufficient-resources.c
new file mode 100644
index 00000000000..b59cd420785
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/insufficient-resources.c
@@ -0,0 +1,21 @@ 
+/* { dg-set-target-env-var "GOMP_OPENACC_DIM" ":33:" } */
+/* { dg-shouldfail "" { openacc_nvidia_accel_selected } } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+#pragma acc parallel vector_length (32)
+  {
+#pragma acc loop worker
+    for (unsigned int i = 0; i < 32; i++)
+#pragma acc loop vector
+      for (unsigned int j = 0; j < 64; j++)
+	;
+  }
+
+  return 0;
+}
+/* { dg-output "The Nvidia accelerator has insufficient resources" { target openacc_nvidia_accel_selected } } */