brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 5af3ca9 Raw
32 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3  real, constant :: rc4  !ERROR: Object 'rcp' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target5  real, constant, pointer :: rcp6  !ERROR: Object 'rct' with ATTRIBUTES(CONSTANT) may not be allocatable, pointer, or target7  real, constant, target :: rct8  real, device, pointer :: dp(:)9  real, device, target :: dt(100)10 contains11  attributes(device) subroutine devsub12    !ERROR: Left-hand side of assignment is not definable13    !BECAUSE: 'rc' has ATTRIBUTES(CONSTANT) and is not definable in a device subprogram14    rc = 1.15    !ERROR: The left-hand side of a pointer assignment is not definable16    !BECAUSE: 'dp' is a pointer and may not be associated in a device subprogram17    dp => dt18  end19  attributes(global) subroutine globsub20    !ERROR: Left-hand side of assignment is not definable21    !BECAUSE: 'rc' has ATTRIBUTES(CONSTANT) and is not definable in a device subprogram22    rc = 1.23    !ERROR: The left-hand side of a pointer assignment is not definable24    !BECAUSE: 'dp' is a pointer and may not be associated in a device subprogram25    dp => dt26  end27  subroutine hostsub28    rc = 1.29    dp => dt30  end31end32