Simple Fortran test for --int64, without math libraries
This commit is contained in:
parent
06e74c9d41
commit
289f895e05
14
test/fc_int64/cmake/autocmake.cfg
Normal file
14
test/fc_int64/cmake/autocmake.cfg
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[project]
|
||||||
|
name: example
|
||||||
|
|
||||||
|
[fc]
|
||||||
|
source: ../../../modules/fc.cmake
|
||||||
|
|
||||||
|
[int64]
|
||||||
|
source: ../../../modules/int64.cmake
|
||||||
|
|
||||||
|
[default_build_paths]
|
||||||
|
source: ../../../modules/default_build_paths.cmake
|
||||||
|
|
||||||
|
[src]
|
||||||
|
source: ../../../modules/src.cmake
|
1
test/fc_int64/src/CMakeLists.txt
Normal file
1
test/fc_int64/src/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
add_executable(example example.f90)
|
14
test/fc_int64/src/example.f90
Normal file
14
test/fc_int64/src/example.f90
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program example
|
||||||
|
implicit none
|
||||||
|
! max i*4 is 2,147,483,647, add 1 for i*8
|
||||||
|
integer*8, parameter :: i8ref = 2147483648
|
||||||
|
integer :: i
|
||||||
|
logical :: test_ok
|
||||||
|
i=i8ref
|
||||||
|
test_ok = (sizeof(i) == 8 .and. i == 2147483648)
|
||||||
|
if (test_ok) then
|
||||||
|
print *,"test_int64 ok"
|
||||||
|
else
|
||||||
|
stop "test_int64 failed!"
|
||||||
|
endif
|
||||||
|
end program
|
@ -137,6 +137,11 @@ def test_fc_git_info():
|
|||||||
stdout, stderr = configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran')
|
stdout, stderr = configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran')
|
||||||
assert 'Test OK!' in stdout
|
assert 'Test OK!' in stdout
|
||||||
|
|
||||||
|
|
||||||
|
def test_fc_int64():
|
||||||
|
stdout, stderr = configure_build_and_exe('fc_int64', 'python setup.py --fc=gfortran --int64')
|
||||||
|
assert 'test_int64 ok' in stdout
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user