Skip to content

[flang] Repair recent Power build bot breakage #124950

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 1 commit into from
Jan 30, 2025
Merged

Conversation

klausler
Copy link
Contributor

Add AIX_WARNING expected warnings to a test that is now producing new warnings.

Should fix https://lab.llvm.org/buildbot/#/builders/201/builds/2291.

@klausler klausler requested a review from kkwli January 29, 2025 17:08
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Jan 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 29, 2025

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

Add AIX_WARNING expected warnings to a test that is now producing new warnings.

Should fix https://lab.llvm.org/buildbot/#/builders/201/builds/2291.


Full diff: https://github.com/llvm/llvm-project/pull/124950.diff

1 Files Affected:

  • (modified) flang/test/Semantics/kinds04_q10.f90 (+3)
diff --git a/flang/test/Semantics/kinds04_q10.f90 b/flang/test/Semantics/kinds04_q10.f90
index aa5c4abe2f1dfc..091bbbc19444dc 100644
--- a/flang/test/Semantics/kinds04_q10.f90
+++ b/flang/test/Semantics/kinds04_q10.f90
@@ -11,11 +11,13 @@ subroutine s(var)
   real :: realvar3 = 4.0Q6
   !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
   real :: realvar4 = 4.0D6_8
+  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
   !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
   real :: realvar5 = 4.0Q6_10
   !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
   real :: realvar6 = 4.0Q6_16
   real :: realvar7 = 4.0E6_8
+  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
   real :: realvar8 = 4.0E6_10
   real :: realvar9 = 4.0E6_16
   !ERROR: Unsupported REAL(KIND=32)
@@ -29,6 +31,7 @@ subroutine s(var)
   !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
   double precision :: doublevar5 = 4.0Q6_16
   double precision :: doublevar6 = 4.0E6_8
+  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
   double precision :: doublevar7 = 4.0E6_10
   double precision :: doublevar8 = 4.0E6_16
   !ERROR: Unsupported REAL(KIND=32)

@kkwli
Copy link
Collaborator

kkwli commented Jan 29, 2025

I guess something is missing. How is AIX_WARNING used?

@kkwli
Copy link
Collaborator

kkwli commented Jan 29, 2025

I see this when I fetch your branch.

! RUN: not %flang_fc1 %s 2>%t.stderr
! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR"%}

@kkwli
Copy link
Collaborator

kkwli commented Jan 29, 2025

I think kinds04_q10.f90 also need to be updated.

$ $HOME/wrk/f/build-flang-local/bin/llvm-lit -v --param flang_site_config=$HOME/wrk/f/build-flang-local/tools/flang/test/lit.site.cfg.py --param flang_config=$HOME/wrk/f/build-flang-local/tools/flang/test/lit.cfg.py $HOME/llvm-project/flang/test/Semantics/kinds04_q10.f90
-- Testing: 1 tests, 1 workers --
FAIL: Flang :: Semantics/kinds04_q10.f90 (1 of 1)
******************** TEST 'Flang :: Semantics/kinds04_q10.f90' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
--- 
+++ 
@@ -3 +2,0 @@

actual at 16: underflow on REAL(10) to REAL(4) conversion@@ -5 +3,0 @@

actual at 21: underflow on REAL(10) to REAL(4) conversion@@ -9 +6,0 @@

actual at 35: underflow on REAL(10) to REAL(8) conversion

FAIL

--
Command Output (stderr):
--
RUN: at line 1: "/usr/bin/python3" /home/kli/llvm-project/flang/test/Semantics/test_errors.py /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90 /home/kli/wrk/f/build-flang-local/bin/flang -fc1
+ /usr/bin/python3 /home/kli/llvm-project/flang/test/Semantics/test_errors.py /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90 /home/kli/wrk/f/build-flang-local/bin/flang -fc1

--

********************
********************
Failed Tests (1):
  Flang :: Semantics/kinds04_q10.f90


Testing Time: 0.55s

Total Discovered Tests: 1
  Failed: 1 (100.00%)

@klausler
Copy link
Contributor Author

Thanks; done.

@@ -29,6 +32,7 @@ subroutine s(var)
!PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
double precision :: doublevar5 = 4.0Q6_16
Copy link
Collaborator

Choose a reason for hiding this comment

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

kinds04_q10.f90:33:36: portability: Explicit kind parameter together with non-'E' exponent letter is not standard
    double precision :: doublevar5 = 4.0Q6_16
                                     ^^^^^

@@ -29,6 +32,7 @@ subroutine s(var)
!PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
double precision :: doublevar5 = 4.0Q6_16
double precision :: doublevar6 = 4.0E6_8
!AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
double precision :: doublevar7 = 4.0E6_10
double precision :: doublevar8 = 4.0E6_16
!ERROR: Unsupported REAL(KIND=32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

on line 39:

kinds04_q10.f90:39:36: error: Unsupported REAL(KIND=32)
    double precision :: doublevar9 = 4.0E6_32
                                     ^^^^^

@kkwli
Copy link
Collaborator

kkwli commented Jan 29, 2025

on powerpc64-*-aix:

$ $HOME/wrk/f/build-flang-local/bin/llvm-lit -v --param flang_site_config=$HOME/wrk/f/build-flang-local/tools/flang/test/lit.site.cfg.py --param flang_config=$HOME/wrk/f/build-flang-local/tools/flang/test/lit.cfg.py $HOME/llvm-project/flang/test/Semantics/kinds04_q10.f90
-- Testing: 1 tests, 1 workers --
FAIL: Flang :: Semantics/kinds04_q10.f90 (1 of 1)
******************** TEST 'Flang :: Semantics/kinds04_q10.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /home/kli/wrk/f/build-flang-local/bin/flang -fc1 /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90 2>/home/kli/wrk/f/build-flang-local/tools/flang/test/Semantics/Output/kinds04_q10.f90.tmp.stderr
+ not /home/kli/wrk/f/build-flang-local/bin/flang -fc1 /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90
RUN: at line 2: /home/kli/wrk/f/build-flang-local/bin/FileCheck /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90 --input-file=/home/kli/wrk/f/build-flang-local/tools/flang/test/Semantics/Output/kinds04_q10.f90.tmp.stderr --check-prefixes="PORTABILITY","WARNING","ERROR","AIX_WARNING"
+ /home/kli/wrk/f/build-flang-local/bin/FileCheck /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90 --input-file=/home/kli/wrk/f/build-flang-local/tools/flang/test/Semantics/Output/kinds04_q10.f90.tmp.stderr --check-prefixes=PORTABILITY,WARNING,ERROR,AIX_WARNING
/home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90:16:12: error: WARNING: expected string not found in input
 !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
           ^
/home/kli/wrk/f/build-flang-local/tools/flang/test/Semantics/Output/kinds04_q10.f90.tmp.stderr:26:120: note: scanning from here
/home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90:36:36: warning: underflow on REAL(10) to REAL(8) conversion
                                                                                                                       ^

Input file: /home/kli/wrk/f/build-flang-local/tools/flang/test/Semantics/Output/kinds04_q10.f90.tmp.stderr
Check file: /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
         21:  double precision :: doublevar4 = 4.0D6_8 
         22:  ^^^^^ 
         23: /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90:33:36: portability: Explicit kind parameter together with non-'E' exponent letter is not standard 
         24:  double precision :: doublevar5 = 4.0Q6_16 
         25:  ^^^^^ 
         26: /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90:36:36: warning: underflow on REAL(10) to REAL(8) conversion 
check:16                                                                                                                            X error: no match found
         27:  double precision :: doublevar7 = 4.0E6_10 
check:16     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         28:  ^^^^^^^^ 
check:16     ~~~~~~~~~~
         29: /home/kli/llvm-project/flang/test/Semantics/kinds04_q10.f90:39:36: error: Unsupported REAL(KIND=32) 
check:16     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         30:  double precision :: doublevar9 = 4.0E6_32 
check:16     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         31:  ^^^^^ 
check:16     ~~~~~~~
>>>>>>

--

********************
********************
Failed Tests (1):
  Flang :: Semantics/kinds04_q10.f90


Testing Time: 0.41s

Total Discovered Tests: 1
  Failed: 1 (100.00%)

@kkwli
Copy link
Collaborator

kkwli commented Jan 29, 2025

This works for ppc64le-*-linux and powerpc*-*-aix.

diff --git a/flang/test/Semantics/kinds04_q10.f90 b/flang/test/Semantics/kinds04_q10.f90
index 45b72fb19184..1063697e1380 100644
--- a/flang/test/Semantics/kinds04_q10.f90
+++ b/flang/test/Semantics/kinds04_q10.f90
@@ -1,5 +1,5 @@
 ! RUN: not %flang_fc1 %s 2>%t.stderr
-! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR","NON_AIX_WARNING"%}
+! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR"%}
 ! C716 If both kind-param and exponent-letter appear, exponent-letter
 ! shall be E. (As an extension we also allow an exponent-letter which matches
 ! the kind-param)
@@ -12,13 +12,13 @@ subroutine s(var)
   real :: realvar3 = 4.0Q6
   !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
   real :: realvar4 = 4.0D6_8
-  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
-  !NON_AIX_WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
+  !WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
+  !AIX_WARNING: underflow on REAL(10) to REAL(4) conversion
   real :: realvar5 = 4.0Q6_10
   !PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
   real :: realvar6 = 4.0Q6_16
   real :: realvar7 = 4.0E6_8
-  !AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
+  !AIX_WARNING: underflow on REAL(10) to REAL(4) conversion
   real :: realvar8 = 4.0E6_10
   real :: realvar9 = 4.0E6_16
   !ERROR: Unsupported REAL(KIND=32)

@klausler
Copy link
Contributor Author

Please approve, @kkwli , if you're happy with this change, or let me know what else needs to be done; thanks.

@klausler
Copy link
Contributor Author

Oh, sorry, I didn't notice the CI failure. Hang on, please.

@@ -1,4 +1,5 @@
! RUN: %python %S/test_errors.py %s %flang_fc1
! RUN: not %flang_fc1 %s 2>%t.stderr
! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR","NON_AIX_WARNING"%}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR","NON_AIX_WARNING"%}
! RUN: FileCheck %s --input-file=%t.stderr --check-prefixes=%if system-aix %{"PORTABILITY","WARNING","ERROR","AIX_WARNING"%} %else %{"PORTABILITY","WARNING","ERROR"%}

Comment on lines 15 to 16
!AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
!NON_AIX_WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
!AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
!NON_AIX_WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
!WARNING: Explicit kind parameter on real constant disagrees with exponent letter 'q'
!AIX_WARNING: underflow on REAL(10) to REAL(4) conversion

real :: realvar5 = 4.0Q6_10
!PORTABILITY: Explicit kind parameter together with non-'E' exponent letter is not standard
real :: realvar6 = 4.0Q6_16
real :: realvar7 = 4.0E6_8
!AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
!AIX_WARNING: underflow on REAL(10) to REAL(8) conversion
!AIX_WARNING: underflow on REAL(10) to REAL(4) conversion

@kkwli
Copy link
Collaborator

kkwli commented Jan 30, 2025

The suggested changes can make things work on ppc64le-*-linux and powerpc*-*-aix.

Add AIX_WARNING expected warnings to a test that is now producing
new warnings.

Should fix https://lab.llvm.org/buildbot/#/builders/201/builds/2291.
@klausler
Copy link
Contributor Author

Should be good to go now.

Copy link
Collaborator

@kkwli kkwli left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix.

@klausler klausler merged commit b4d52a9 into llvm:main Jan 30, 2025
7 checks passed
@klausler klausler deleted the fix-power branch January 30, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants