Skip to content

doc(test/README.md): add IBM test result #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,24 @@ This repository also adds

Supported Compilers
-------------------
Correct execution of the Smart Pointers library code requires comprehensive
compiler support for Fortran's type finalization feature. The unit test suite
verifies the relevant compiler standard-conformance, including a test for each
scenario in which the Fortran 2018 standard requires that an object be finalized.
The table below summarizes the observed compiler behaviors:
Correct execution of the Smart Pointers library depends critically on comprehensive
compiler support for type finalization. The unit test suite verifies the relevant
compiler standard-conformance, including a test for each scenario in which the
the Fortran 2018 standard requires that an object be finalized. The table below
summarizes the observed compiler behaviors:

| _Compiler_ | _Test failures_ | _Version tested_ |
| :--- | :---: | :--- |
| NAG | 0 | `nagfor` 7.1 Build 7113 |
| IBM | 1 | `xlf2003_r` 17.1.0 on AIX |
| Intel | 2 | `ifort` 2021.5.0 Build 20211109\_000000 |
| NVIDIA | 2 | `nvfortran` 22.7-0 |
| Cray | 3 | `ftn` 13.0.1 |
| GCC | 6 | `gfortran` 12.2.0 |
| NVIDIA | Fails to build (ICE) | `nvfortran` 2022.2 |
| AMD | Fails to build (ICE) | `flang` 13.0.0 (AOCC_3.2.0-Build\#128 2021\_11\_12) |

See the [test suite README.md](./test/README.md) for more details on each compiler's test
failures.
results.

Downloading, Building, and Testing
----------------------------------
Expand All @@ -91,16 +92,21 @@ followed by one of the commands below corresponding to your compiler choice.
fpm test --compiler nagfor --flag -fpp
```

### GCC (`gfortran`)
### IBM (`xlf2003_r`)
```
fpm test
fpm test --compiler xlf2003_r
```

### Intel (`ifort`)
```
fpm test --compiler ifort --flag -coarray=shared
```

### GCC (`gfortran`)
```
fpm test
```

### NVIDIA (`nvfortran`)
```
fpm test --compiler nvfortran --flag -Mpreprocess
Expand Down
173 changes: 150 additions & 23 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,161 @@ This directory contains two categories of unit tests separated into two files:

`compiler_test.f90` verifies that a compiler calls a type's final subroutine
in each of the scenarios in which the Fortran standard requires finalization
to occur.
to occur. Because one test must run as an external subprogram and because
passing that test involves error termination, that test is in the separate
file [specification_expression_finalization.f90].

`nagfor` 7.1.0
--------------
:trophy: The Numerical Algorithms Group (NAG) Fortran [compiler] passes all
reference-counter tests.
* [NAG]
* [GNU]
* [Cray]
* [Intel]
* [NVIDIA]
* [IBM]

`gfortran` 12.2.0
-----------------
Because the first usage test listed below causes a segmentation fault,
obtaining the `gfortran` test results requires skipping that test by,
for example, running running individual tests as follows:
NAG
---
- Version: 7.1 (Build 7113)
- Result: 0 test failures. :trophy:

```
nagfor compile_me_only.f90
./a.out
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Pass: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Pass: finalizes a function reference on the RHS of an intrinsic assignment
Pass: finalizes a specification expression function result
Pass: finalizes an intent(out) derived type dummy argument
Pass: finalizes an allocatable component object
```

GNU
---
- Version: 12.2.0
- Result: 4 test failures.

Because the first usage test causes a segmentation fault when compiled
with `gfortran`, obtaining the test results requires skipping that test
by running individual tests as follows:
```
fpm test -- -f "<description>"
```
Replace <description> above with one of the enumerated test descriptions
below or with a corresponding substring not contained in the first usage
test description.
Replace <description> above with one of the enumerated test descriptions,
shown after a colon below, or with a corresponding substring not contained
in the first usage test description.

```
gfortran compile_me_only.f90
./a.out
Fail: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Fail: finalizes a function reference on the RHS of an intrinsic assignment
Fail: finalizes a specification expression function result
Pass: finalizes an intent(out) derived type dummy argument
Pass: finalizes an allocatable component object
```

Cray
----
- Version: 13.0.1
- Result: 3 test failures.
```
ftn compile_me_only.f90
./a.out
Cray Fortran : Version 13.0.1 fails to compile specification_expression_finalization.f90
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Pass: finalizes a function reference on the RHS of an intrinsic assignment
Fail: finalizes a specification expression function result
Fail: finalizes an intent(out) derived type dummy argument
Pass: finalizes an allocatable component object
```

Intel
-----
- Version: 2021.1 Beta Build 20200827
- Result: 2 test failures.
```
ifort compile_me_only.f90
./a.out
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Pass: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Fail: finalizes a function reference on the RHS of an intrinsic assignment
Pass: finalizes a specification expression function result
Pass: finalizes an intent(out) derived type dummy argument
Fail: finalizes an allocatable component object

```

NVIDIA
------
- Version: 22.7-0 64-bit target on x86-64 Linux -tp zen3
- Result: 2 test failures

```
nvfortran compile_me_only.f90
./a.out
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Pass: finalizes a function reference on the RHS of an intrinsic assignment
Pass: finalizes a specification expression function result
Fail: finalizes an intent(out) derived type dummy argument
Pass: finalizes an allocatable component object
```

IBM
---
- Version: IBM Open XL Fortran for AIX 17.1.0
- Result: 1 test failure

### Failing checks in `compiler_test.f90`
GFortran fails to finalize
1. a non-allocatable object on the LHS of an intrinsic assignment
2. an allocated allocatable LHS of an intrinsic assignment
3. a function reference on the RHS of an intrinsic assignment
4. a specification expression function result
In order to for the tests to complete in a way that reports all of the results,
place an exclamation mark (`!`) at the beginning of the following line in the
`compile_me_only.f90` file:
```
,test_result_t("finalizes a specification expression function result", specification_expression()) &
```
which removes the one failing test. Compiling and excuting the same file then

### Failing checks in `usage_test.f90`
1. copy points to the same resource as the original
2. has zero references after a shallow copy goes out of scope
```
xlf2003_r compile_me_only.f90
./a.out
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
Pass: finalizes an allocated allocatable LHS of an intrinsic assignment
Pass: finalizes a target when the associated pointer is deallocated
Pass: finalizes an object upon explicit deallocation
Pass: finalizes a non-pointer non-allocatable object at the END statement
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
Pass: finalizes a function reference on the RHS of an intrinsic assignment
Pass: finalizes an intent(out) derived type dummy argument
Pass: finalizes an allocatable component object
```
**Fail:** Separately compiling `specification_expression_finalization.f90` with
`xlf2003_r` causes a core dump. This is a compiler bug that has been reported to
via the Oak Ridge Leadership Computing Facility (OLCF) under ticket OLCFHELP-9069.

[compiler]: https://www.nag.com/content/nag-fortran-compiler
[NAG]: #nag
[GNU]: #gnu
[Cray]: #cray
[Intel]: #intel
[NVIDIA]: #nvidia
[IBM]: #ibm
[specification_expression_finalization.f90]: ../example/test-support/specification_expression_finalization.f90