brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 32c3517 Raw
49 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2 3module m4  !ERROR: 'x1' may not have both the BIND(C) and PARAMETER attributes5  integer, parameter, bind(c, name="a") :: x1 = 16  !ERROR: 'x2' may not have both the BIND(C) and PARAMETER attributes7  integer, bind(c), parameter :: x2 = 18 9  !ERROR: 'x3' may not have both the BIND(C) and PARAMETER attributes10  integer, parameter :: x3 = 111  bind(c) :: x312 13  !ERROR: 'x4' may not have both the ALLOCATABLE and PARAMETER attributes14  !ERROR: 'x4' may not have both the ASYNCHRONOUS and PARAMETER attributes15  !ERROR: 'x4' may not have both the SAVE and PARAMETER attributes16  !ERROR: 'x4' may not have both the TARGET and PARAMETER attributes17  !ERROR: 'x4' may not have both the VOLATILE and PARAMETER attributes18  !ERROR: The entity 'x4' with an explicit SAVE attribute must be a variable, procedure pointer, or COMMON block19  !ERROR: An entity may not have the ASYNCHRONOUS attribute unless it is a variable20  integer, parameter :: x4 = 121  allocatable x422  asynchronous x423  save x424  target x425  volatile x426 27  type :: my_type128    integer :: x429  end type30  type, bind(c) :: my_type231    integer :: x532  end type33 34  !ERROR: 't1' may not have both the BIND(C) and PARAMETER attributes35  !WARNING: The derived type of an interoperable object should be BIND(C)36  type(my_type1), bind(c), parameter :: t1 = my_type1(1)37  !ERROR: 't2' may not have both the BIND(C) and PARAMETER attributes38  type(my_type2), bind(c), parameter :: t2 = my_type2(1)39 40  type(my_type2), parameter :: t3 = my_type2(1) ! no error41  !ERROR: 't4' may not have both the BIND(C) and PARAMETER attributes42  !WARNING: The derived type of an interoperable object should be BIND(C)43  type(my_type1), parameter :: t4 = my_type1(1)44  !ERROR: 't5' may not have both the BIND(C) and PARAMETER attributes45  type(my_type2), parameter :: t5 = my_type2(1)46  bind(c) :: t4, t547 48end49