[gomp4, PATCH] Fix libgomp.oacc-c-c++-common/lib-3.c
Thomas Schwinge
thomas@codesourcery.com
Wed Jul 22 14:38:00 GMT 2015
Hi Tom!
On Wed, 1 Jul 2015 13:16:14 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
> testcase libgomp.oacc-c-c++-common/lib-3.c is supposed to fail.
>
> It fails currently in two ways:
> - no device found, if there is no nonhost device type supported, so
> just host and host_nonshm
> - no device initialized, if there is a nonhost device type supported,
> f.i. nvidia
>
> The reason for the different failure modes is the usage of
> acc_device_not_host.
>
> Neither of the current failure modes is matches by the current dg-output:
> ...
> /* { dg-output "device \[0-9\]+\\\(\[0-9\]+\\\) is initialized" } */
> ...
> I don't understand what this dg-output is trying to achieve.
Yeah, neither do I. I guess the behavior of libgomp changed at some
point. (For avoidance of doubt, the current behavior is in accord with
the specification, as far as I can tell.)
> Attached patch makes sure that both current failure modes are tested and
> accepted.
> Fix libgomp.oacc-c-c++-common/lib-3.c
>
> 2015-07-01 Tom de Vries <tom@codesourcery.com>
>
> * testsuite/lib/libgomp.exp (offload_targets_nonhost): New var.
> (check_effective_target_offload_target_nonhost_supported): New proc.
> * testsuite/libgomp.oacc-c-c++-common/lib-3.c: Only run if
> offload_target_nonhost_supported.
> * testsuite/libgomp.oacc-c-c++-common/lib-3b.c: New test. Copy of
> lib-3.c, but only run if !offload_target_nonhost_supported.
Thanks, but that seemed a bit heavy-weight to me to justify this for just
the small thing that this test case is, so in r226070, I committed the
following to gomp-4_0-branch:
commit bb8f2ef333bb999e6d5e9fe834efab3fbbefa6d8
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Jul 22 14:24:22 2015 +0000
libgomp: Resolve XFAIL in libgomp.oacc-c-c++-common/lib-3.c
libgomp/
* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Resolve XFAIL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@226070 138bc75d-0d04-0410-961f-82ee72b054a4
---
libgomp/ChangeLog.gomp | 4 ++++
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c | 10 +++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 746003f..d71282c 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2015-07-22 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c-c++-common/lib-3.c: Resolve XFAIL.
+
2015-07-21 James Norris <jnorris@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Additional tests.
diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c
index d5f390d..e00053c 100644
--- libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c
+++ libgomp/testsuite/libgomp.oacc-c-c++-common/lib-3.c
@@ -1,4 +1,6 @@
-/* { dg-do run } */
+/* Expect an error message when shutting down a device different from the one
+ that has been initialized. */
+/* { dg-do run { target { ! openacc_host_selected } } } */
#include <openacc.h>
@@ -6,12 +8,10 @@ int
main (int argc, char **argv)
{
acc_init (acc_device_host);
-
- acc_shutdown (acc_device_not_host);
+ acc_shutdown (acc_device_default);
return 0;
}
-/* TODO: currently prints: "libgomp: no device found". */
-/* { dg-output "device \[0-9\]+\\\(\[0-9\]+\\\) is initialized" { xfail *-*-* } } */
+/* { dg-output "no device initialized" } */
/* { dg-shouldfail "" } */
Grüße,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150722/0abd9f56/attachment.sig>
More information about the Gcc-patches
mailing list