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

51 lines
1.3 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
module m1
integer :: x
integer, private :: y
interface operator(.foo.)
module procedure ifoo
end interface
interface operator(-)
module procedure ifoo
end interface
interface operator(.priv.)
module procedure ifoo
end interface
interface operator(*)
module procedure ifoo
end interface
private :: operator(.priv.), operator(*)
contains
integer function ifoo(x, y)
logical, intent(in) :: x, y
end
end
use m1, local_x => x
!ERROR: 'y' is PRIVATE in 'm1'
use m1, local_y => y
!ERROR: 'z' not found in module 'm1'
use m1, local_z => z
use m1, operator(.localfoo.) => operator(.foo.)
!ERROR: 'OPERATOR(.bar.)' not found in module 'm1'
use m1, operator(.localbar.) => operator(.bar.)
!ERROR: 'y' is PRIVATE in 'm1'
use m1, only: y
!ERROR: 'OPERATOR(.priv.)' is PRIVATE in 'm1'
use m1, only: operator(.priv.)
!ERROR: 'OPERATOR(*)' is PRIVATE in 'm1'
use m1, only: operator(*)
!ERROR: 'z' not found in module 'm1'
use m1, only: z
!ERROR: 'z' not found in module 'm1'
use m1, only: my_x => z
use m1, only: operator(.foo.)
!ERROR: 'OPERATOR(.bar.)' not found in module 'm1'
use m1, only: operator(.bar.)
use m1, only: operator(-) , ifoo
!ERROR: 'OPERATOR(+)' not found in module 'm1'
use m1, only: operator(+)
end