From: Kwok Cheung Yeung Date: Fri, 26 Jun 2020 17:35:36 +0000 (-0700) Subject: Fix failure in gfortran.dg/gomp/combined-if.f90 test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca79a89b9b90bd76cd026898bfa2b8aaf8395e6e;p=thirdparty%2Fgcc.git Fix failure in gfortran.dg/gomp/combined-if.f90 test Enabling nvptx offloading results in extra '#pragma omp simd' statements in the tree dump with an extra '_simt_'. This is a backport from master (commit 0fce12c0920c12492c878c0ca5f639f93b93f183). 2020-06-26 Kwok Cheung Yeung gcc/testsuite/ * gfortran.dg/gomp/combined-if.f90: Adjust expected number of matches depending on whether nvptx offloading is supported. * lib/target-supports.exp (check_effective_target_offload_nvptx): New. --- diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index 0a8afc8644ec..817c627e8ed2 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,3 +1,10 @@ +2020-06-26 Kwok Cheung Yeung + + * gfortran.dg/gomp/combined-if.f90: Adjust expected number + of matches depending on whether nvptx offloading is supported. + * lib/target-supports.exp + (check_effective_target_offload_nvptx): New. + 2020-06-25 Tobias Burnus Kwok Cheung Yeung diff --git a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 index bf4a9a85d34d..0bb6c28b286a 100644 --- a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 @@ -104,5 +104,6 @@ contains end module ! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 9 "omplower" } } -! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7 "omplower" } } +! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 4 "omplower" { target { ! offload_nvptx } } } } +! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7 "omplower" { target { offload_nvptx } } } } ! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 6 "omplower" } } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 094bb5218aae..dcf05513229c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -9754,6 +9754,14 @@ proc check_effective_target_vect_max_reduc { } { return 0 } +# Return 1 if the compiler has been configured with nvptx offloading. + +proc check_effective_target_offload_nvptx { } { + return [check_no_compiler_messages offload_nvptx assembly { + int main () {return 0;} + } "-foffload=nvptx-none" ] +} + # Return 1 if the compiler has been configured with hsa offloading. proc check_effective_target_offload_hsa { } { @@ -9762,7 +9770,7 @@ proc check_effective_target_offload_hsa { } { } "-foffload=hsa" ] } -# Return 1 if the compiler has been configured with hsa offloading. +# Return 1 if the compiler has been configured with gcn offloading. proc check_effective_target_offload_gcn { } { return [check_no_compiler_messages offload_gcn assembly {