brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · eca5b4c Raw
40 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2module m03  real, pointer, contiguous :: p1(:) ! ok4  real, pointer :: p2(:)5end6module m7  use m08  !WARNING: Use-associated 'p1' already has 'CONTIGUOUS' attribute [-Wredundant-attribute]9  contiguous p110  !ERROR: Cannot change CONTIGUOUS attribute on use-associated 'p2'11  contiguous p212  !PORTABILITY: CONTIGUOUS entity 'x' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]13  real, contiguous :: x14  !PORTABILITY: CONTIGUOUS entity 'scalar' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]15  real, contiguous, pointer :: scalar16  !PORTABILITY: CONTIGUOUS entity 'allocatable' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]17  real, contiguous, allocatable :: allocatable18 contains19  !PORTABILITY: CONTIGUOUS entity 'func' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]20  function func(ashape,arank) result(r)21    real, contiguous :: ashape(:) ! ok22    real, contiguous :: arank(..) ! ok23    !PORTABILITY: CONTIGUOUS entity 'r' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]24    real :: r(10)25    !PORTABILITY: CONTIGUOUS entity 'r2' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]26    real :: r2(10)27    contiguous func28    contiguous r29    contiguous e30    contiguous r231    !PORTABILITY: CONTIGUOUS entity 'e' should be an array pointer, assumed-shape, or assumed-rank [-Wredundant-contiguous]32    entry e() result(r2)33    r2 = 034  end35  function fp()36    real, pointer, contiguous :: fp(:) ! ok37    nullify(fp)38  end39end40