File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ include(testing)
55
66project (gfortran-bug Fortran)
77
8+ add_compiler_test(SOURCES gfortran-20200402-file1.f90 gfortran-20200402-file2.f90
9+ LINK_ONLY LABELS PR94463)
810add_compiler_test(SOURCES gfortran-20190202.f90 RUN_ONLY LABELS PR89174)
911add_compiler_test(SOURCES gfortran-20180610.f90 LABELS PR86100
1012 COMPILE_FLAGS "-g -fcheck=bounds" )
Original file line number Diff line number Diff line change 1+ ! See gfortran-20200402-file2.f90 for description
2+
3+ module scalar_func_class
4+ type, abstract :: scalar_func
5+ end type
6+ end module
Original file line number Diff line number Diff line change 1+ ! ! https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94463
2+ ! !
3+ ! ! LINK FAILURE
4+ ! !
5+ ! ! In this example the compiler generates a reference to the undefined
6+ ! ! symbol __vtab_scalar_func_class_Scalar_func.3804. The example is split
7+ ! ! across two source files (see gfortran-20200402-file1.f90). Note that
8+ ! ! the symbol __scalar_func_class_MOD___vtab_scalar_func_class_Scalar_func
9+ ! ! is defined in gfortran-20200402-file1.o.
10+ ! !
11+ ! ! This failure appears to occur for all versions of gfortran.
12+ ! !
13+ ! ! $ gfortran gfortran-20200402-file1.f90 -c
14+ ! ! $ gfortran gfortran-20200402-file2.f90 gfortran-20200402-file1.o
15+ ! ! /usr/bin/ld: /tmp/ccNS7CfH.o: in function `__fubar_MOD_edit_short':
16+ ! ! gfortran-20200402-file2.f90:(.text+0x1f): undefined reference to `__vtab_scalar_func_class_Scalar_func.3905'
17+ ! ! /usr/bin/ld: gfortran-20200402-file2.f90:(.text+0x8f): undefined reference to `__vtab_scalar_func_class_Scalar_func.3905'
18+ ! ! collect2: error: ld returned 1 exit status
19+ ! !
20+
21+ module material_model_type
22+ contains
23+ subroutine alloc_phase_prop (func )
24+ use scalar_func_class, only: scalar_func
25+ class(scalar_func), allocatable , intent (out ) :: func
26+ end subroutine
27+ end module
28+
29+ module fubar
30+ contains
31+ subroutine edit_short
32+ use material_model_type, only: alloc_phase_prop
33+ use scalar_func_class, only: scalar_func
34+ class(scalar_func), allocatable :: f
35+ call alloc_phase_prop(f)
36+ end subroutine
37+ end module
38+
39+ end
You can’t perform that action at this time.
0 commit comments