diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-03-17 10:12:44 +0100 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-03-17 10:12:44 +0100 |
commit | 2d5c1e5149809f978ea2c07517de13fdbb925de6 (patch) | |
tree | 9b5c3d3df6e55d1486968b673c1924bd3b0b7113 /gcc | |
parent | b58a0af4e2e28b395a3cb4b7283f16f05c0cf3c8 (diff) | |
download | gcc-2d5c1e5149809f978ea2c07517de13fdbb925de6.zip gcc-2d5c1e5149809f978ea2c07517de13fdbb925de6.tar.gz gcc-2d5c1e5149809f978ea2c07517de13fdbb925de6.tar.bz2 |
Move gfortran.dg/gomp/declare-variant-mod-1*.f90 to libgomp.fortran/ [PR115271]
The test is a supposed to be a compile-only test but as dg-additional-sources
does not work with dg-compile (due to compiling with '-o'), dg-link had to
be used; as the code actually compiles (no diagnostic error), the linker
is actually invoked, which fails unless the system compiler by chance
provides the required files. Solution: move the test to libgomp.
PR fortran/115271
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/declare-variant-mod-1-use.f90: Move to
libgomp/testsuite/libgomp.fortran/.
* gfortran.dg/gomp/declare-variant-mod-1.f90: Likewise.
libgomp/ChangeLog:
* testsuite/libgomp.fortran/declare-variant-mod-1-use.f90: Moved
from gcc/testsuite/gfortran.dg/gomp/.
* testsuite/libgomp.fortran/declare-variant-mod-1.f90: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1-use.f90 | 81 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1.f90 | 83 |
2 files changed, 0 insertions, 164 deletions
diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1-use.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1-use.f90 deleted file mode 100644 index 759f8fc..0000000 --- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1-use.f90 +++ /dev/null @@ -1,81 +0,0 @@ -! { dg-do compile { target skip-all-targets } } -! used by declare-variant-mod-1.f90 - -! Check that module-file handling works for declare_variant -! and its match/adjust_args/append_args clauses -! -! PR fortran/115271 - -subroutine test1 - use m1 - use iso_c_binding, only: c_loc, c_ptr - implicit none (type, external) - - integer :: i, j - type(c_ptr) :: a1, b1, c1, x1, y1, z1 - - !$omp dispatch - i = m1_g (a1, b1, c1) - j = m1_g (x1, y1, z1) -end -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr \\(c1.\[0-9\]+, D\\.\[0-9\]+\\);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr \\(a1, D\\.\[0-9\]+\\);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "i = m1_f \\(D\\.\[0-9\]+, &b1, &D\\.\[0-9\]+\\);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "j = m1_g \\(x1, &y1, &z1\\);" 1 "gimplify" } } - -subroutine test2 - use m2, only: m2_g - use iso_c_binding, only: c_loc, c_ptr - implicit none (type, external) - - integer :: i, j - type(c_ptr) :: a2, b2, c2, x2, y2, z2 - - !$omp dispatch - i = m2_g (a2, b2, c2) - j = m2_g (x2, y2, z2) -end -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (c2.\[0-9\]+, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (a2, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "i = m2_f (D\\.\[0-9\]+, &b2, &D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "j = m2_g \\(x2, &y2, &z2\\);" 1 "gimplify" } } - -subroutine test3 - use m2, only: my_func => m2_g - use iso_c_binding, only: c_loc, c_ptr - implicit none (type, external) - - integer :: i, j - type(c_ptr) :: a3, b3, c3, x3, y3, z3 - - !$omp dispatch - i = my_func (a3, b3, c3) - j = my_func (x3, y3, z3) -end -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (c3.\[0-9\]+, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (a3, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "i = m2_f (D\\.\[0-9\]+, &b3, &D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "j = m2_g \\(x3, &y3, &z3\\);" 1 "gimplify" } } - -subroutine test4 - use m3, only: my_m3_g - use iso_c_binding, only: c_loc, c_ptr - implicit none (type, external) - - integer :: i, j - type(c_ptr) :: a4, b4, c4, x4, y4, z4 - - !$omp dispatch - i = my_m3_g (a4, b4, c4) - j = my_m3_g (x4, y4, z4) -end -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (c4.\[0-9\]+, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr (a4, D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "i = m3_f (D\\.\[0-9\]+, &b4, &D\\.\[0-9\]+);" 1 "gimplify" } } -! { dg-final { scan-tree-dump-times "j = m3_g \\(x4, &y4, &z4\\);" 1 "gimplify" } } - -program main - call test1 - call test2 - call test3 -end diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1.f90 deleted file mode 100644 index b6ed2c7..0000000 --- a/gcc/testsuite/gfortran.dg/gomp/declare-variant-mod-1.f90 +++ /dev/null @@ -1,83 +0,0 @@ -! { dg-do link } -! { dg-additional-options "-fdump-tree-gimple" } -! { dg-additional-sources "declare-variant-mod-1-use.f90" } - -! Note: We have to use 'link' as otherwise '-o' is specified, -! which does not work with multiple files. - -! Check that module-file handling works for declare_variant -! and its match/adjust_args/append_args clauses -! -! PR fortran/115271 - -! Define to make linker happy -integer function m1_f (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x -end - -integer function m1_g (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x -end - -module m1 - implicit none (type, external) - - interface - integer function m1_f (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - end - integer function m1_g (x, y, z) - !$omp declare variant(m1_f) match(construct={dispatch}) adjust_args(need_device_ptr: x, 3) adjust_args(nothing: y) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - end - end interface -end module m1 - -module m2 - implicit none (type, external) -contains - integer function m2_f (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - m2_f = 1 - end - integer function m2_g (x, y, z) - !$omp declare variant(m2_f) match(construct={dispatch}) adjust_args(need_device_ptr: x, 3) adjust_args(nothing: y) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - m2_g = 2 - end -end module m2 - -module m3_pre - implicit none (type, external) -contains - integer function m3_f (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - m3_f = 1 - end - integer function m3_g (x, y, z) - use iso_c_binding - type(c_ptr) :: x, y, z - value :: x - m3_g = 2 - end -end module m3_pre - -module m3 - use m3_pre, only: my_m3_f => m3_f, my_m3_g => m3_g - implicit none (type, external) - !$omp declare variant(my_m3_g : my_m3_f) match(construct={dispatch}) adjust_args(need_device_ptr: 1, 3) adjust_args(nothing: 2) -end module m3 |