1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 ! Test warnings and errors about DIM= arguments to transformational intrinsics
7 real, intent(in
) :: a(:)
8 !ERROR: The value of DIM= (-1) may not be less than 1
12 real, intent(in
) :: a(:)
13 !ERROR: The value of DIM= (2) may not be greater than 1
17 real, intent(in
) :: a(:)
18 integer, optional
, intent(in
) :: d
19 !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time
21 !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time
25 real, intent(in
) :: a(:)
26 integer, pointer, intent(in
) :: d
27 !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time
31 real, intent(in
) :: a(:)
32 integer, allocatable
, intent(in
) :: d
33 !PORTABILITY: The actual argument for DIM= is optional, pointer, or allocatable, and it is assumed to be present and equal to 1 at execution time
37 real, intent(in
) :: a(:,:)
38 real, allocatable
:: f10a(:)
39 !ERROR: The value of DIM= (-1) may not be less than 1
43 real, intent(in
) :: a(:,:)
44 real, allocatable
:: f10b(:)
45 !ERROR: The value of DIM= (3) may not be greater than 2
49 real, intent(in
) :: a(:,:)
50 integer, optional
, intent(in
) :: d
51 real, allocatable
:: f11(:)
52 !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning
54 !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning
58 real, intent(in
) :: a(:,:)
59 integer, pointer, intent(in
) :: d
60 real, allocatable
:: f12(:)
61 !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning
65 real, intent(in
) :: a(:,:)
66 integer, allocatable
, intent(in
) :: d
67 real, allocatable
:: f13(:)
68 !WARNING: The actual argument for DIM= is optional, pointer, or allocatable, and may not be absent during execution; parenthesize to silence this warning