[flang-commits] [flang] [flang][test] Restrict Semantics/kinds04_q10.f90 to x86_64 (PR #103724)
Daniel Chen via flang-commits
flang-commits at lists.llvm.org
Tue Aug 27 10:53:53 PDT 2024
DanielCChen wrote:
The two test files, `kinds04_q10.f90` and `kinds04_q16.f90` are identical in terms of Fortran code.
The difference is (obviously) `_q10.f90` runs only on x86 target and `q16_f90` only runs on non-x86 target.
The reason of splitting the same code into two different test files seems due to Flang FE issues different messages for the same code depending on the platform it is targeting.
The following examples are from the test file.
Example 1,
```
real :: realvar5 = 4.0Q6_10
x86:
!PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
non-x86:
!WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
```
Example 2:
```
real :: realvar6 = 4.0Q6_16
x86:
!WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
non-x86:
!PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
```
I am not sure if I agree with the x86 message for the 2nd example as exponent letter `q` seems consistent with kind parameter `16`.
On top of what is shown at the above, on AIX (big-endian), there is also an extra message for the code in the 1st example as
```
underflow on REAL(10) to REAL(4) conversion
```
It is due to the reason I mentioned in the previous post that on AIX, the constant is 0x7FFF (+infinity) rather than a valid number that can be converted to REAL*16.
I fixed `kinds04_q16.f90` that runs on non-x86 target for AIX via PR #104792.
As for the test case in the PR, `kinds04_q10.f90`, because it already excludes `system-aix` in the header, it is not an issue for AIX.
I think these two test files could be merged into one as the source code are identical, and use the `--check-prefix` to specify different checks for different platforms.
https://github.com/llvm/llvm-project/pull/103724
More information about the flang-commits
mailing list