Skip to content

Commit d40a8f9

Browse files
committed
test(Cray ftn): partial support (4 test failures)
1 parent 1b01017 commit d40a8f9

File tree

5 files changed

+36
-40
lines changed

5 files changed

+36
-40
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,19 @@ compiler standard-conformance, including a test for each scenario in which the
6464
the Fortran 2023 standard requires that an object be finalized. The table below
6565
summarizes the observed compiler behaviors:
6666

67-
| _Compiler_ | _Test failures_ | _Version tested_ |
68-
| :--- | :---: | :--- |
69-
| AMD `flang` | N.A. (see Note 1.) | 13.0.0 (AOCC_3.2.0-Build\#128 2021\_11\_12) |
70-
| Cray `ftn` | >= 3 (see Note 2.) | 13.0.1 |
71-
| GCC `gfortran` :trophy: | 0 | 13.1.0 |
72-
| IBM `xlf2008_r` | 1 | 17.1.0 on AIX |
73-
| Intel `ifort` | 1 | 2021.7.0 Build 20220726_000000 |
74-
| Intel `ifx` | 1 | 2024.0.0 Build 20231017 |
75-
| LLVM `flang` :trophy: | 0 | 19.0.0 `git` commit 325f5123 |
76-
| NAG `nagfor` :trophy: | 0 | 7.1 Build 7113 |
77-
| NVIDIA `nvfortran` | 2 | 22.7-0 |
78-
79-
**Notes**
80-
1. Fails to build due to an internal compiler error (ICE).
81-
2. Fails to build due to `fpm` issue [767]. See [test/README.md#cray] for a lower bound on the Cray compiler test failures.
67+
| _Compiler_ | _Test failures_ | _Version tested_ |
68+
| :--- | :---: | :--- |
69+
| AMD `flang` | N.A. (see Note) | 13.0.0 (AOCC_3.2.0-Build\#128 2021\_11\_12) |
70+
| Cray `ftn` | 4 | 17.0.0 |
71+
| GCC `gfortran` :trophy: | 0 | 13.1.0 |
72+
| IBM `xlf2008_r` | 1 | 17.1.0 on AIX |
73+
| Intel `ifort` | 1 | 2021.7.0 Build 20220726_000000 |
74+
| Intel `ifx` | 1 | 2024.0.0 Build 20231017 |
75+
| LLVM `flang` :trophy: | 0 | 19.0.0 `git` commit 325f5123 |
76+
| NAG `nagfor` :trophy: | 0 | 7.1 Build 7113 |
77+
| NVIDIA `nvfortran` | 2 | 22.7-0 |
78+
79+
Note: AMD `flang` fails to build Smart-Pointers due to an internal compiler error (ICE).
8280

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

example/test-support/specification_expression_finalization.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ program specification_expression_finalization
6767
contains
6868

6969
subroutine finalize_specification_expression_result
70+
#ifndef _CRAYFTN
7071
real tmp(component(finalizable_t(component=0))) !! Finalizes the finalizable_t function result
7172
real eliminate_unused_variable_warning
7273
tmp = eliminate_unused_variable_warning
74+
#endif
7375
end subroutine
7476

7577
end program

test/README.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,27 @@ Detailed Results
3030
- Result: Fails to build due to an internal compiler error (ICE)
3131

3232
### Cray
33-
- Version: 13.0.1
34-
- Result: at least 3 test failures.
35-
The Smart-Pointers library does not currenlty build with the Cray Fortran compiler, but
36-
the compiler standard-conformance tests embodied in [compiler_test_m.f90] also exist in
37-
a standalone format in a type-finalization [branch] of the Berkely Lab fork of the
38-
llvm-test-suite repository. The reslts of running those compiler test show three compiler
39-
test failures as follows:
33+
- Version: 17.0.0
34+
- Result: 4 test failures.
4035
```
41-
git clone https://github.com/berkeleylab/llvm-test-suite
42-
cd llvm-test-suite/Fortran/UnitTests/finalization
43-
ftn compile_me_only.f90
44-
> ./a.out
45-
Cray Fortran : Version 13.0.1 fails to compile specification_expression_finalization.f90
46-
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
47-
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
48-
Pass: finalizes a target when the associated pointer is deallocated
49-
Pass: finalizes an object upon explicit deallocation
50-
Pass: finalizes a non-pointer non-allocatable object at the END statement
51-
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
52-
Pass: finalizes a function reference on the RHS of an intrinsic assignment
53-
Fail: finalizes a specification expression function result
54-
Fail: finalizes an intent(out) derived type dummy argument
55-
Pass: finalizes an allocatable component object
36+
The compiler
37+
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
38+
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
39+
Pass: finalizes a target when the associated pointer is deallocated
40+
Pass: finalizes an object upon explicit deallocation
41+
Pass: finalizes a non-pointer non-allocatable object at the END statement
42+
Pass: finalizes a non-pointer non-allocatable object at END BLOCK statement
43+
Pass: finalizes a function reference on the RHS of an intrinsic assignment
44+
Pass: finalizes a specification expression function result
45+
Fail: finalizes an intent(out) derived type dummy argument
46+
Pass: finalizes an allocatable component object
47+
48+
A smart_pointer
49+
Pass: creates a resource when constructed
50+
Fail: removes the resource when the object goes out of scope
51+
Pass: copy points to the same resource as the original
52+
Fail: has zero references after a shallow copy goes out of scope
5653
```
57-
The number of unit test failures for the remainder of the Smart-Pointers test suite is unknown.
5854

5955
### GCC
6056
- Version: 13.1.0
File renamed without changes.

test/sp_smart_pointer_test_m.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function check_deletion() result(test_passes)
9191
function check_copy() result(test_passes)
9292
logical test_passes
9393
type(object_t) :: reference
94-
#ifdef XLF
94+
#if defined(XLF) || defined(_CRAYFTN)
9595
type(object_t) :: original
9696

9797
original = object_t()
@@ -107,7 +107,7 @@ function check_copy() result(test_passes)
107107
reference_to_declared = declared
108108
test_passes = associated(original%ref, reference%ref) .and. associated(declared%ref, reference_to_declared%ref)
109109
end block
110-
#ifndef XLF
110+
#if !defined(XLF) && !defined(_CRAYFTN)
111111
end associate
112112
#endif
113113

0 commit comments

Comments
 (0)