public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4.1] Add testcase for map clause bit-field diagnostics
@ 2015-10-13  7:22 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2015-10-13  7:22 UTC (permalink / raw)
  To: gcc-patches

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.

--- 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" } */
+  }
+}

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-13  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13  7:22 [gomp4.1] Add testcase for map clause bit-field diagnostics Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).