Fix failure in gfortran.dg/gomp/combined-if.f90 test
authorKwok Cheung Yeung <kcy@codesourcery.com>
Fri, 26 Jun 2020 17:35:36 +0000 (10:35 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Fri, 26 Jun 2020 18:22:45 +0000 (11:22 -0700)
Enabling nvptx offloading results in extra '#pragma omp simd' statements
in the tree dump with an extra '_simt_'.

2020-06-26  Kwok Cheung Yeung  <kcy@codesourcery.com>

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.

gcc/testsuite/gfortran.dg/gomp/combined-if.f90
gcc/testsuite/lib/target-supports.exp

index bf4a9a85d34dc98ac307c54f5af112de5e1eb4d9..0bb6c28b286a11e02de5e3fe1c344945ea691aa6 100644 (file)
@@ -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" } }
index cf0cfa11eb982698e1c2a4384c76789399a32664..2279361175d6eae0c37731d6cfb4d955c4d2a7ff 100644 (file)
@@ -9820,6 +9820,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 { } {
@@ -9828,7 +9836,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 {