[flang-commits] [PATCH] D137030: [flang] Improve warning message
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Sat Oct 29 17:29:37 PDT 2022
klausler updated this revision to Diff 471797.
klausler added a comment.
Correct the test results for Evaluate/folding04.f90.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137030/new/
https://reviews.llvm.org/D137030
Files:
flang/lib/Evaluate/host.cpp
flang/test/Evaluate/folding04.f90
Index: flang/test/Evaluate/folding04.f90
===================================================================
--- flang/test/Evaluate/folding04.f90
+++ flang/test/Evaluate/folding04.f90
@@ -17,26 +17,44 @@
!WARN: warning: division by zero
real(4), parameter :: r4_ninf = -1._4/0._4
- !WARN: warning: invalid argument on intrinsic function
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
real(4), parameter :: nan_r4_acos1 = acos(1.1)
TEST_ISNAN(nan_r4_acos1)
- !WARN: warning: invalid argument on intrinsic function
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
real(4), parameter :: nan_r4_acos2 = acos(r4_pmax)
TEST_ISNAN(nan_r4_acos2)
- !WARN: warning: invalid argument on intrinsic function
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
real(4), parameter :: nan_r4_acos3 = acos(r4_nmax)
TEST_ISNAN(nan_r4_acos3)
- !WARN: warning: invalid argument on intrinsic function
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
real(4), parameter :: nan_r4_acos4 = acos(r4_ninf)
TEST_ISNAN(nan_r4_acos4)
- !WARN: warning: invalid argument on intrinsic function
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
real(4), parameter :: nan_r4_acos5 = acos(r4_pinf)
TEST_ISNAN(nan_r4_acos5)
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
+ real(8), parameter :: nan_r8_dasin1 = dasin(-1.1_8)
+ TEST_ISNAN(nan_r8_dasin1)
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
+ real(8), parameter :: nan_r8_dlog1 = dlog(-0.1_8)
+ TEST_ISNAN(nan_r8_dlog1)
+ !WARN: warning: division by zero on evaluation of intrinsic function or operation
+ complex(4), parameter :: c4_clog1 = clog((0., 0.))
!WARN: warning: second argument to MOD must not be zero
real(4), parameter :: nan_r4_mod = mod(3.5, 0.)
TEST_ISNAN(nan_r4_mod)
-
- !WARN: warning: overflow on intrinsic function
+ real(4), parameter :: ok_r4_gamma = gamma(-1.1)
+ !WARN: warning: division by zero on evaluation of intrinsic function or operation
+ real(4), parameter :: r4_gamma1 = gamma(0.)
+ !WARN: warning: invalid argument on evaluation of intrinsic function or operation
+ real(4), parameter :: r4_gamma2 = gamma(-1.)
+ real(4), parameter :: ok_r4_log_gamma = log_gamma(-2.001)
+ !WARN: warning: division by zero on evaluation of intrinsic function or operation
+ real(4), parameter :: r4_log_gamma1 = log_gamma(0.)
+ !WARN: warning: division by zero on evaluation of intrinsic function or operation
+ real(4), parameter :: r4_log_gamma2 = log_gamma(-100001.)
+ real(4), parameter :: r4_atan2 = atan2(0., 0.)
+ !WARN: warning: overflow on evaluation of intrinsic function or operation
logical, parameter :: test_exp_overflow = exp(256._4).EQ.r4_pinf
end module
Index: flang/lib/Evaluate/host.cpp
===================================================================
--- flang/lib/Evaluate/host.cpp
+++ flang/lib/Evaluate/host.cpp
@@ -141,7 +141,8 @@
}
if (!flags_.empty()) {
- RealFlagWarnings(context, flags_, "intrinsic function");
+ RealFlagWarnings(
+ context, flags_, "evaluation of intrinsic function or operation");
}
errno = 0;
if (fesetenv(&originalFenv_) != 0) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137030.471797.patch
Type: text/x-patch
Size: 3384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221030/65fe277e/attachment.bin>
More information about the flang-commits
mailing list