Skip to content

[Fortran] Enable gfortran tests that now pass#426

Open
tarunprabhu wants to merge 4 commits into
llvm:mainfrom
llvm-project-tlp:enable-tests
Open

[Fortran] Enable gfortran tests that now pass#426
tarunprabhu wants to merge 4 commits into
llvm:mainfrom
llvm-project-tlp:enable-tests

Conversation

@tarunprabhu

Copy link
Copy Markdown
Contributor

NOTE FOR REVIEWERS: I have requested a reviews from several people because prior experience suggests that some tests are dependent on system configuration and libraries and pass on some systems and not others. If more of you could check that there are no failures, it should reduce the likelihood of post-commit buildbot failures.

@luporl

luporl commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

On AArch64 I see 2 failures:

Failed Tests (2):
  test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__pr80918_f90.test
  test-suite :: Fortran/gfortran/regression/ieee/gfortran-regression-execute-regression__ieee__comparisons_3_F90.test

pr80918 was disabled by #425.

Output of gfortran-regression-execute-regression__ieee__comparisons_3_F90:

 Check failed at  444
Fortran STOP: code 1

IEEE arithmetic exceptions signaled: INVALID

Comment thread Fortran/gfortran/regression/gomp/DisabledFiles.cmake Outdated
@pawosm-arm

pawosm-arm commented Jun 16, 2026

Copy link
Copy Markdown

Ah, I started it hours ago, but I think it stuck on these two (according to htop):
Fortran/gfortran/regression/gfortran-regression-execute-regression__pointer_check_12_f90
Fortran/gfortran/regression/gfortran-regression-execute-regression__do_check_1_f90

EDIT: final verdict:

Failed Tests (4):
  test-suite :: Fortran/gfortran/regression/gfortran-regression-execute-regression__do_check_1_f90.test
  test-suite :: Fortran/gfortran/regression/gfortran-regression-execute-regression__pointer_check_12_f90.test
  test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__pr80918_f90.test
  test-suite :: Fortran/gfortran/regression/ieee/gfortran-regression-execute-regression__ieee__comparisons_3_F90.test


Testing Time: 10086.42s

Total Discovered Tests: 10523
  Passed: 10519 (99.96%)
  Failed:     4 (0.04%)

@tblah tblah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hanging tests for me, but two failed:

Failed Tests (2):
  test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__pr80918_f90.test
  test-suite :: Fortran/gfortran/regression/ieee/gfortran-regression-execute-regression__ieee__comparisons_3_F90.test

@pawosm-arm

pawosm-arm commented Jun 16, 2026

Copy link
Copy Markdown

hanging tests

I suspect this isn't related to this PR.

@tarunprabhu

Copy link
Copy Markdown
Contributor Author

hanging tests

I suspect this isn't related to this PR.

pointer_check_12.f90 was not disabled before. The test is expected to fail at runtime with a helpful error message (with libgfortran). For me on Linux, x86-64, it segfaults - presumably because libflang does not currently support those error messages. But I have seen this behavior before where some tests would hang instead of failing depending on the optimization level. I honestly don't know how to handle such cases. There are several of those in the gfortran test suite.


# unimplemented: procedure components
proc_ptr_24.f90
structure_constructor_11.f90

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test suite build fails on structure_constructor_11.f90 on my test system with an AMD Milan CPU.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking. Do you know what the error was in this case?

@cenewcombe cenewcombe Jun 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After revisiting this, I see it's a linker error in my test environment, so you should leave the test enabled. The object legitimately requires an executable stack because the test takes the address of internal procedures, implemented with stack trampolines.

# flang structure_constructor_11.f90 
ld.lld: error: /tmp/structure_constructor_11-92364d.o: requires an executable stack, but -z execstack is not specified
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)

The test links fine when I use -Wl,-z,execstack. Is there a spot where we set LDFLAGS for the gfortran regression tests? It would be good to make this robust across linkers without depending on the user config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a second look.

We generally don't set LDFLAGS for all the tests at once, and I am also not sure if, for example, -DCMAKE_LINKER_EXE_FLAGS is passed on to the gfortran tests. There is an override.yaml file allows some parameters to be overridden, but I can't remember if compiler/linker options can be changed using that. The README.md in Fortran/gfortran should describe how to use it.

@AlexisPerry

Copy link
Copy Markdown

I am running into some failures trying to build the test suite that may be linked to the version of gcc that I have access to (gcc 13.2.0):

[1/5] Linking Fortran executable Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_f90
FAILED: Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_f90 
: && /vast/home/aperry/local/llvm-main/bin/flang  -O3 Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_f90.dir/fmt_en.f90.o -o Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_f90   && :
Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_f90.dir/fmt_en.f90.o: In function `_QFPcheckfmt':
FIRModule:(.text+0x27f6): undefined reference to `__truncsfbf2'
FIRModule:(.text+0x280d): undefined reference to `__truncsfhf2'
FIRModule:(.text+0x2a0d): undefined reference to `__truncsfbf2'
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)
[2/5] Linking Fortran executable Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rz_f90
FAILED: Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rz_f90 
: && /vast/home/aperry/local/llvm-main/bin/flang  -O3 Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rz_f90.dir/fmt_en_rz.f90.o -o Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rz_f90   && :
Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rz_f90.dir/fmt_en_rz.f90.o: In function `_QFPcheckfmt':
FIRModule:(.text+0x3883): undefined reference to `__truncsfbf2'
FIRModule:(.text+0x389a): undefined reference to `__truncsfhf2'
FIRModule:(.text+0x3b86): undefined reference to `__truncsfbf2'
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)
[3/5] Linking Fortran executable Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_ru_f90
FAILED: Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_ru_f90 
: && /vast/home/aperry/local/llvm-main/bin/flang  -O3 Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_ru_f90.dir/fmt_en_ru.f90.o -o Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_ru_f90   && :
Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_ru_f90.dir/fmt_en_ru.f90.o: In function `_QFPcheckfmt':
FIRModule:(.text+0x3833): undefined reference to `__truncsfbf2'
FIRModule:(.text+0x384a): undefined reference to `__truncsfhf2'
FIRModule:(.text+0x3b36): undefined reference to `__truncsfbf2'
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)
[4/5] Linking Fortran executable Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rd_f90
FAILED: Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rd_f90 
: && /vast/home/aperry/local/llvm-main/bin/flang  -O3 Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rd_f90.dir/fmt_en_rd.f90.o -o Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rd_f90   && :
Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rd_f90.dir/fmt_en_rd.f90.o: In function `_QFPcheckfmt':
FIRModule:(.text+0x3843): undefined reference to `__truncsfbf2'
FIRModule:(.text+0x385a): undefined reference to `__truncsfhf2'
FIRModule:(.text+0x3b46): undefined reference to `__truncsfbf2'
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)
[5/5] Linking Fortran executable Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rn_f90
FAILED: Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rn_f90 
: && /vast/home/aperry/local/llvm-main/bin/flang  -O3 Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rn_f90.dir/fmt_en_rn.f90.o -o Fortran/gfortran/regression/gfortran-regression-execute-regression__fmt_en_rn_f90   && :
Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__fmt_en_rn_f90.dir/fmt_en_rn.f90.o: In function `_QFPcheckfmt':
FIRModule:(.text+0x37e3): undefined reference to `__truncsfbf2'
FIRModule:(.text+0x37fa): undefined reference to `__truncsfhf2'
FIRModule:(.text+0x3ae6): undefined reference to `__truncsfbf2'
flang-23: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: cannot make progress due to previous errors.

@tarunprabhu

Copy link
Copy Markdown
Contributor Author

I am running into some failures trying to build the test suite that may be linked to the version of gcc that I have access to (gcc 13.2.0):

Thanks for checking. I'll re-disable those tests for now.

@AlexisPerry

Copy link
Copy Markdown

I am running into some failures trying to build the test suite that may be linked to the version of gcc that I have access to (gcc 13.2.0):

Thanks for checking. I'll re-disable those tests for now.

Thank you! I have pulled and re-run and now I am getting timeouts for the following two tests:

test-suite :: Fortran/gfortran/regression/gfortran-regression-execute-regression__pointer_check_12_f90.test
test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__requires-self-maps_f90.test

@tarunprabhu

Copy link
Copy Markdown
Contributor Author

Thank you! I have pulled and re-run and now I am getting timeouts for the following two tests:

test-suite :: Fortran/gfortran/regression/gfortran-regression-execute-regression__pointer_check_12_f90.test test-suite :: Fortran/gfortran/regression/gomp/gfortran-regression-compile-regression__gomp__requires-self-maps_f90.test

Thanks for checking.

pointer_check_12.f90 was also reported to be failing for @pawosm-arm. requires-self-maps.f90 was always enabled. What is the error that you are seeing?

Since both of these tests have always been enabled, I will leave them enabled for now. After I sync them with upstream, I will try to reproduce these failures to see if we can identify the cause.

@kwyatt-ext

Copy link
Copy Markdown
Contributor

It built and ran fine in my setup.

@tarunprabhu

Copy link
Copy Markdown
Contributor Author

Thank you to everyone that tested this. I will leave this up for a few more days to give more folks a chance to test, and will merge this early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants