The libgomp.c-c++-common/struct-elem-5.c test which I added for the Structure
element mapping patch, does not properly "fail" for non-shared (unified) address
space cases (like host-fallback).

This was handled inside the testcase for struct-elem-[14].c, but missed this
one due to the dg-shouldfail nature.

Fixed by adding "target offload_device_nonshared_as" to dg-run. This is
quite small and obvious, so directly committed after testing.

Chung-Lin

libgomp/ChangeLog:

        PR testsuite/101114
        * testsuite/libgomp.c-c++-common/struct-elem-5.c:
        Add "target offload_device_nonshared_as" condition for enabling test.

From e0672017370b9a9362fda52ecffe33d1c9c41829 Mon Sep 17 00:00:00 2001
From: Chung-Lin Tang <clt...@codesourcery.com>
Date: Sat, 26 Jun 2021 00:42:58 +0800
Subject: [PATCH] testsuite/101114: Adjust libgomp.c-c++-common/struct-elem-5.c
 testcase

The dg-shouldfail testcase libgomp.c-c++-common/struct-elem-5.c does not
properly fail for non-shared address space offloading. Adjust testcase
to limit testing only for "target offload_device_nonshared_as".

libgomp/ChangeLog:

        PR testsuite/101114
        * testsuite/libgomp.c-c++-common/struct-elem-5.c:
        Add "target offload_device_nonshared_as" condition for enabling test.
---
 libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c 
b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c
index 814c30120e5..31a2fa5e8cf 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target offload_device_nonshared_as } } */
 
 struct S
 {
-- 
2.17.1

Reply via email to