Skip to content

Commit 9b8ea8f

Browse files
authored
Merge pull request #62 from Goddard-Fortran-Ecosystem/develop
Develop
2 parents 5c02056 + 586c2e3 commit 9b8ea8f

File tree

7 files changed

+85
-9
lines changed

7 files changed

+85
-9
lines changed

cmake_utils/Intel.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
1919
set(CMAKE_Fortran_FLAGS "-g ${cpp} ${traceback} ${check_all} ${disable_warning_for_long_names} -save-temps")
2020

2121
add_definitions(-D_INTEL)
22+
#add_definitions(-D__ifort_18)

include/templates/altSet_decl.inc

-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,9 @@
3636
procedure :: remove => __PROC(remove)
3737
procedure :: begin => __PROC(begin)
3838
procedure :: end => __PROC(end)
39-
!!$#ifdef _DUMP_TREE
4039
procedure :: dump => __PROC(dump)
41-
!!$#endif
4240
procedure :: deepCopy => __PROC(deepCopy)
43-
#ifndef __ifort_18
4441
generic :: assignment(=) => deepCopy
45-
#endif
4642
procedure :: equalSets
4743
generic :: operator(==) => equalSets
4844
procedure :: notEqualSets

include/templates/altSet_impl.inc

+1-2
Original file line numberDiff line numberDiff line change
@@ -944,14 +944,13 @@
944944
type (__iterator) :: iter
945945
__type_declare_result, pointer :: ptr
946946

947-
#if !defined(__INTEL_COMPILER) | !(defined(_string) & !defined(_string_deferred))
948947
iter = other%begin()
949948
do while (iter /= other%end())
950949
ptr => iter%value()
951950
call this%insert(ptr)
952951
call iter%next()
953952
end do
954-
#endif
953+
955954
this%tsize = other%tsize
956955

957956
end subroutine __PROC(deepCopy)

include/templates/vector_decl.inc

-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@
6666

6767
#ifndef __type_wrapped
6868
procedure :: copyFromArray => __PROC(copyfromarray)
69-
#ifndef __ifort_18
7069
generic :: assignment(=) => copyFromArray
71-
#endif
7270
#endif
7371
procedure :: push_back => __PROC(push_back)
7472
procedure :: pop_back => __PROC(pop_back)

tests/Map/CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ add_custom_command (
9393
WORKING_DIRECTORY ${bin}
9494
DEPENDS ${src}/Test_map_Allocatable.pf
9595
)
96-
list(APPEND SRCS Test_map_Allocatable.F90)
96+
97+
add_custom_command (
98+
OUTPUT Test_map_double_assign.F90
99+
COMMAND ${PFUNIT}/bin/pFUnitParser.py ${src}/Test_map_double_assign.pf Test_map_double_assign.F90
100+
WORKING_DIRECTORY ${bin}
101+
DEPENDS ${src}/Test_map_double_assign.pf
102+
)
103+
list(APPEND SRCS Test_map_Allocatable.F90 Test_map_double_assign.F90)
97104

98105
add_custom_command (
99106
OUTPUT AuxTest.F90

tests/Map/Test_map_double_assign.pf

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
! Test for use fArgParse use case that fails with ifort-19. Issue is
2+
! apparently related to copying of StringUnlimited maps at multiple
3+
! levels. In the use case a function is used to return a map, and the
4+
! retun value is itself a function return at the level above.
5+
6+
module String_mod
7+
implicit none
8+
private
9+
10+
public :: String
11+
type :: String
12+
character(:), allocatable :: string
13+
end type String
14+
15+
end module String_mod
16+
17+
module UnlimitedMap_mod
18+
#include "types/key_deferredLengthString.inc"
19+
#include "types/value_unlimitedPoly.inc"
20+
#define _alt
21+
#include "templates/map.inc"
22+
end module UnlimitedMap_mod
23+
24+
25+
module Test_map_double_assigne_mod
26+
use String_mod
27+
use pFUnit_mod
28+
use UnlimitedMap_mod
29+
30+
@suite(name='Test_map_double_assign_suite')
31+
32+
type :: ArgParser
33+
class(*), allocatable :: default
34+
end type ArgParser
35+
36+
37+
contains
38+
39+
subroutine get_defaults(this, option_values)
40+
type (Map), intent(out) :: option_values
41+
class (ArgParser), target, intent(inout) :: this
42+
43+
class(*), pointer :: q
44+
45+
this%default = 'TestRunner'
46+
q => this%default
47+
48+
select type (q)
49+
type is (character(*))
50+
print*,__FILE__,__LINE__
51+
call option_values%insert('runner', String(q))
52+
end select
53+
54+
end subroutine get_defaults
55+
56+
@test
57+
subroutine test_unlimited
58+
type (Map) :: m
59+
type (ArgParser) :: p
60+
61+
class(*), pointer :: opt
62+
63+
print*,__FILE__,__LINE__
64+
call get_defaults(p, m)
65+
opt => m%at('runner')
66+
select type (opt)
67+
class is (String)
68+
@assertEqual('TestRunner', opt%string)
69+
class default
70+
@assertFalse(.true.,message='should not get here')
71+
end select
72+
73+
end subroutine test_unlimited
74+
end module Test_map_double_assigne_mod

tests/Map/altMapTestSuites.inc

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ ADD_TEST_SUITE(Test_integer1dinteger1daltMap_mod_suite)
3232

3333
! Test for robust pointers to allocatable components
3434
ADD_TEST_SUITE(Test_map_Allocatable_suite)
35+
ADD_TEST_SUITE(Test_map_double_assign_suite)

0 commit comments

Comments
 (0)