brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 9d33fa9 Raw
47 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror2program call453    integer, target :: v(100) = [(i, i=1, 100)]4    integer, pointer :: p(:) => v5    !ERROR: Actual argument associated with VOLATILE dummy argument 'v=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]6    !BECAUSE: Variable 'v([INTEGER(8)::1_8,2_8,2_8,3_8,3_8,3_8,4_8,4_8,4_8,4_8])' has a vector subscript7    call sub(v([1,2,2,3,3,3,4,4,4,4]))8    !PORTABILITY: The array section 'v(21_8:30_8:1_8)' should not be associated with dummy argument 'v=' with VOLATILE attribute, unless the dummy is assumed-shape or assumed-rank [-Wportability]9    call sub(v(21:30))10    !WARNING: The array section 'v(21_8:40_8:2_8)' should not be associated with dummy argument 'v=' with VOLATILE attribute, unless the dummy is assumed-shape or assumed-rank [-Wvolatile-or-asynchronous-temporary]11    call sub(v(21:40:2))12    call sub2(v(21:40:2))13    call sub4(p)14    call sub5(p)15    print *, v16contains17    subroutine sub(v)18        integer, volatile :: v(10)19        v = 020    end subroutine sub21    subroutine sub1(v)22        integer, volatile :: v(:)23        v = 024    end subroutine sub125    subroutine sub2(v)26        integer :: v(:)27        !PORTABILITY: The actual argument 'v' should not be associated with dummy argument 'v=' with VOLATILE attribute, because a temporary copy is required during the call [-Wportability]28        call sub(v)29        call sub1(v)30    end subroutine sub231    subroutine sub3(v)32        integer, pointer :: v(:)33        v = 034    end subroutine sub335    subroutine sub4(v)36        integer, pointer :: v(:)37        !PORTABILITY: The actual argument 'v' should not be associated with dummy argument 'v=' with VOLATILE attribute, because a temporary copy is required during the call [-Wportability]38        call sub(v)39        call sub1(v)40        call sub3(v)41        call sub5(v)42    end subroutine sub443    subroutine sub5(v)44        integer, pointer, volatile :: v(:)45    end subroutine sub546end program call4547