Simple Fortran test for --int64, without math libraries

This commit is contained in:
Miro ILIAS 2015-08-06 08:46:34 +02:00
parent 06e74c9d41
commit 289f895e05
4 changed files with 34 additions and 0 deletions

View 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

View File

@ -0,0 +1 @@
add_executable(example example.f90)

View 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

View File

@ -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
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------