[flang-commits] [flang] [flang] Add new hints to expected warnings (PR #146399)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Jun 30 11:18:48 PDT 2025


https://github.com/klausler created https://github.com/llvm/llvm-project/pull/146399

I added a new test with warnings, but warnings are now emitted with hints.  Add them to the new test.

>From cc1a869606b41324af78ab0b2aa814948ba739b1 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Mon, 30 Jun 2025 11:17:21 -0700
Subject: [PATCH] [flang] Add new hints to expected warnings

I added a new test with warnings, but warnings are now emitted
with hints.  Add them to the new test.
---
 flang/test/Semantics/bug1046.f90 | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/flang/test/Semantics/bug1046.f90 b/flang/test/Semantics/bug1046.f90
index a266651f90c31..dc5c470621387 100644
--- a/flang/test/Semantics/bug1046.f90
+++ b/flang/test/Semantics/bug1046.f90
@@ -1,17 +1,15 @@
 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror
-!WARNING: INTEGER(4) 0**0 is not defined
+!WARNING: INTEGER(4) 0**0 is not defined [-Wfolding-exception]
 print *, 0**0
-!WARNING: REAL/COMPLEX 0**0 is not defined
+!WARNING: REAL/COMPLEX 0**0 is not defined [-Wfolding-exception]
 print *, 0**0.
-!WARNING: invalid argument on power with INTEGER exponent
+!WARNING: invalid argument on power with INTEGER exponent [-Wfolding-exception]
 print *, 0.0**0
-!WARNING: REAL/COMPLEX 0**0 is not defined
+!WARNING: REAL/COMPLEX 0**0 is not defined [-Wfolding-exception]
 print *, 0.0**0.
-!WARNING: invalid argument on power with INTEGER exponent
+!WARNING: invalid argument on power with INTEGER exponent [-Wfolding-exception]
 print *, (0.0, 0.0)**0
-!WARNING: REAL/COMPLEX 0**0 is not defined
+!WARNING: REAL/COMPLEX 0**0 is not defined [-Wfolding-exception]
 print *, (0.0, 0.0)**0.
 print *, (0.0, 0.0)**2.5
 end
-
-



More information about the flang-commits mailing list