llvm-project/flang/test/Semantics/if_arith02.f90
Ivan Zhechev 6c1ac141d3 [Flang] Ported test_errors.sh to Python
To enable Flang testing on Windows, shell scripts have to be ported to Python. In this patch the "test_errors.sh" script is ported to python ("test_errors.py"). The RUN line of existing tests was changed to make use of the python script.

Used python regex in place of awk/sed.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D107575
2021-09-06 08:19:42 +00:00

38 lines
854 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Check that only labels are allowed in arithmetic if statements.
! TODO: Revisit error message "expected 'ASSIGN'" etc.
! TODO: Revisit error message "expected one of '0123456789'"
! TODO: BUG: Note that labels 500 and 600 do not exist and
! ought to be flagged as errors. This oversight may be the
! result of disabling semantic checking after syntax errors.
if ( A ) 500, 600, 600
100 CONTINUE
200 CONTINUE
300 CONTINUE
!ERROR: expected 'ASSIGN'
!ERROR: expected 'ALLOCATE ('
!ERROR: expected '=>'
!ERROR: expected '('
!ERROR: expected '='
if ( B ) A, 101, 301
101 CONTINUE
201 CONTINUE
301 CONTINUE
!ERROR: expected one of '0123456789'
if ( B ) 102, A, 302
102 CONTINUE
202 CONTINUE
302 CONTINUE
!ERROR: expected one of '0123456789'
if ( B ) 103, 103, A
103 CONTINUE
203 CONTINUE
303 CONTINUE
END