diff mbox

[gomp4.1] Add testcase for map clause bit-field diagnostics

Message ID 20151013072252.GE478@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Oct. 13, 2015, 7:22 a.m. UTC
Hi!

Bit-fields are for obvious reasons disallowed in map clause (one can't take
address of them, it would be too complicated and racy to move them to and
from device), but we didn't have a testcase for it.

2015-10-13  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/gomp/map-3.c: New test.


	Jakub
diff mbox

Patch

--- gcc/testsuite/c-c++-common/gomp/map-3.c.jj	2015-10-12 13:59:09.872114839 +0200
+++ gcc/testsuite/c-c++-common/gomp/map-3.c	2015-10-12 13:58:25.000000000 +0200
@@ -0,0 +1,21 @@ 
+struct S { int i : 1; int j : 4; long long k : 25; };
+void bar (struct S, int);
+#pragma omp declare target to (bar)
+
+void
+foo (struct S a, struct S b, struct S c, struct S d)
+{
+  #pragma omp target map (a)
+  bar (a, 0);
+  #pragma omp target map (a) map (b.i)		/* { dg-error "bit-field .b.\(S::\|\)i. in .map. clause" } */
+  bar (a, b.i);
+  #pragma omp target map (a) map (b.j)		/* { dg-error "bit-field .b.\(S::\|\)j. in .map. clause" } */
+  bar (a, b.j);
+  #pragma omp target map (a) map (b.k)		/* { dg-error "bit-field .b.\(S::\|\)k. in .map. clause" } */
+  bar (a, b.k);
+  #pragma omp target data map (a) map (b.i)	/* { dg-error "bit-field .b.\(S::\|\)i. in .map. clause" } */
+  {
+    #pragma omp target enter data map (alloc: a) map (to: c.j)		/* { dg-error "bit-field .c.\(S::\|\)j. in .map. clause" } */
+    #pragma omp target exit data map (release: a) map (from: d.k)	/* { dg-error "bit-field .d.\(S::\|\)k. in .map. clause" } */
+  }
+}