diff --git a/flang/test/Semantics/altreturn04.f90 b/flang/test/Semantics/altreturn04.f90 --- 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 --- 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