With a compiler setup to compile (also) for nvptx offloading,
the testcase triggered a bogus error - and that prevents in
addition the gimple scan.

Fixed by adding an xfail and an xfailed dg-bogus.

The issue itself is the known https://gcc.gnu.org/PR118694

Committed as obvious asr15-7606-g8d922a80396b0c, cf. attachment. Tobias
commit 8d922a80396b0cc9f5311d79aa760412dd018848
Author: Tobias Burnus <tbur...@baylibre.com>
Date:   Tue Feb 18 15:48:39 2025 +0100

    gfortran.dg/gomp/metadirective-3.f90: xfail on offload_nvptx
    
    Currently, 'target' with a nested metadirective creating a 'teams' will
    fail with a bogus error ("‘target’ construct with nested ‘teams’ construct
    contains directives outside of the ‘teams’ construct").
    That's tracked at PR118694 - and, hence, expected.
    
    However, the testcase metadirective-3.f90 triggers this when compiling for
    'target offload_nvptx' (otherwise, the code is optimized away). Use xfail to
    silence the error as it is known and there is a tracking PR.
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/gomp/metadirective-3.f90: Add xfail when
            compiling for offload_nvptx.
---
 gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90 b/gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90
index c5e25e598eb..e2ebb0a39c1 100644
--- a/gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90
@@ -22,4 +22,7 @@ end module
 !  that alternative and not produce a metadirective at all.  Otherwise this
 !  won't be resolved until late.
 ! { dg-final { scan-tree-dump-not "#pragma omp metadirective" "gimple" { target { ! offload_nvptx } } } }
-! { dg-final { scan-tree-dump "#pragma omp metadirective" "gimple" { target { offload_nvptx } } } }
+
+! The following two are xfail because the bogus error triggers and thus prevents the dump, cf. PR118694
+! { dg-final { scan-tree-dump "#pragma omp metadirective" "gimple" { target { offload_nvptx } xfail { offload_nvptx } } } }
+! { dg-bogus "'target' construct with nested 'teams' construct contains directives outside of the 'teams' construct" "PR118694" { xfail offload_nvptx } 10 }

Reply via email to