[flang-commits] [flang] b2f9bde - [flang][NFC] Allow whitespaces before `ERROR`

Daniil Dudkin via flang-commits flang-commits at lists.llvm.org
Thu May 19 07:13:36 PDT 2022


Author: Daniil Dudkin
Date: 2022-05-19T17:13:02+03:00
New Revision: b2f9bde2e0e0fb9a26c2809aed17213e0920cf0f

URL: https://github.com/llvm/llvm-project/commit/b2f9bde2e0e0fb9a26c2809aed17213e0920cf0f
DIFF: https://github.com/llvm/llvm-project/commit/b2f9bde2e0e0fb9a26c2809aed17213e0920cf0f.diff

LOG: [flang][NFC] Allow whitespaces before `ERROR`

This change allows to write whitespaces before the `ERROR` keyword
in semantic tests for consistency with other testing infrastructure.

Also, one test is changed in order to test if the change works
correctly.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D125884

Added: 
    

Modified: 
    flang/test/Semantics/altreturn04.f90
    flang/test/Semantics/test_errors.py

Removed: 
    


################################################################################
diff  --git a/flang/test/Semantics/altreturn04.f90 b/flang/test/Semantics/altreturn04.f90
index 9285bb730731..9ed9a7d96754 100644
--- a/flang/test/Semantics/altreturn04.f90
+++ b/flang/test/Semantics/altreturn04.f90
@@ -2,6 +2,6 @@
 ! Functions cannot use alt return
 
 REAL FUNCTION altreturn01(X)
-!ERROR: RETURN with expression is only allowed in SUBROUTINE subprogram
+! ERROR: RETURN with expression is only allowed in SUBROUTINE subprogram
   RETURN 1
 END

diff  --git a/flang/test/Semantics/test_errors.py b/flang/test/Semantics/test_errors.py
index ce176e270f5d..50f7a68a7959 100755
--- a/flang/test/Semantics/test_errors.py
+++ b/flang/test/Semantics/test_errors.py
@@ -49,7 +49,7 @@
 # Gets the expected errors and their line number
 errors = []
 for i, line in enumerate(src, 1):
-    m = re.search(r"(?:^\s*!ERROR: )(.*)", line)
+    m = re.search(r"(?:^\s*!\s*ERROR: )(.*)", line)
     if m:
         errors.append(m.group(1))
         continue


        


More information about the flang-commits mailing list