aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Parser
diff options
context:
space:
mode:
authorPeter Klausler <35819229+klausler@users.noreply.github.com>2023-11-13 16:13:50 -0800
committerGitHub <noreply@github.com>2023-11-13 16:13:50 -0800
commit1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8 (patch)
treecf9c2d958a333e7dbbe60c600a5ad025ce41b049 /flang/test/Parser
parenta5eb6bdd8e126ad94de0a12002cac2c3f01e05f5 (diff)
downloadllvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.zip
llvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.tar.gz
llvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.tar.bz2
[flang] Ensure that portability warnings are conditional (#71857)
Before emitting a warning message, code should check that the usage in question should be diagnosed by calling ShouldWarn(). A fair number of sites in the code do not, and can emit portability warnings unconditionally, which can confuse a user that hasn't asked for them (-pedantic) and isn't terribly concerned about portability *to* other compilers. Add calls to ShouldWarn() or IsEnabled() around messages that need them, and add -pedantic to tests that now require it to test their portability messages, and add more expected message lines to those tests when -pedantic causes other diagnostics to fire.
Diffstat (limited to 'flang/test/Parser')
-rw-r--r--flang/test/Parser/badlabel.f2
-rw-r--r--flang/test/Parser/continuation-before-quote.f902
-rw-r--r--flang/test/Parser/excessive-continuations.f902
3 files changed, 3 insertions, 3 deletions
diff --git a/flang/test/Parser/badlabel.f b/flang/test/Parser/badlabel.f
index ea36ec6..7842803 100644
--- a/flang/test/Parser/badlabel.f
+++ b/flang/test/Parser/badlabel.f
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -E -fno-reformat %s 2>&1 | FileCheck %s
+! RUN: %flang_fc1 -E -fno-reformat -pedantic %s 2>&1 | FileCheck %s
! CHECK: Label digit is not in fixed-form label field
1 continue
! CHECK: Label digit is not in fixed-form label field
diff --git a/flang/test/Parser/continuation-before-quote.f90 b/flang/test/Parser/continuation-before-quote.f90
index 4ae669f..66252010 100644
--- a/flang/test/Parser/continuation-before-quote.f90
+++ b/flang/test/Parser/continuation-before-quote.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
+! RUN: %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s
! Continuation between repeated quotation marks
subroutine test
!CHECK: portability: Repeated quote mark in character literal continuation line should have been preceded by '&'
diff --git a/flang/test/Parser/excessive-continuations.f90 b/flang/test/Parser/excessive-continuations.f90
index e5855cf..83becf6 100644
--- a/flang/test/Parser/excessive-continuations.f90
+++ b/flang/test/Parser/excessive-continuations.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
+! RUN: %flang_fc1 -fdebug-unparse -pedantic %s 2>&1 | FileCheck %s
! CHECK: portability: 256 continuation lines is more than the Fortran standard allows
! CHECK: LOGICAL, PARAMETER :: c255 = .true._4
program test