73 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic2! This test is responsible for checking the fix for passing non-variables as3! actual arguments to subroutines/functions whose corresponding dummy argument4! expects a VOLATILE variable5! c.f. llvm-project GitHub issue #589736 7module m8 contains9 subroutine vol_dum_int(my_int)10 integer, volatile :: my_int11 end subroutine vol_dum_int12 13 subroutine vol_dum_real(my_real)14 real, volatile :: my_real15 end subroutine vol_dum_real16 17 subroutine vol_dum_complex(my_complex)18 complex, volatile :: my_complex19 end subroutine vol_dum_complex20 21 subroutine vol_dum_int_arr(my_int_arr)22 integer, dimension(2,2), volatile :: my_int_arr23 end subroutine vol_dum_int_arr24 25 subroutine test_all_subprograms()26 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]27 !BECAUSE: '6_4' is not a variable or pointer28 call vol_dum_int(6)29 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]30 !BECAUSE: '18_4' is not a variable or pointer31 call vol_dum_int(6+12)32 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]33 !BECAUSE: '72_4' is not a variable or pointer34 call vol_dum_int(6*12)35 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]36 !BECAUSE: '-3_4' is not a variable or pointer37 call vol_dum_int(-6/2)38 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]39 !BECAUSE: '3.1415927410125732421875_4' is not a variable or pointer40 call vol_dum_real(3.141592653)41 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]42 !BECAUSE: '3.1415927410125732421875_4' is not a variable or pointer43 call vol_dum_real(3.141592653 + (-10.6e-11))44 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]45 !BECAUSE: '3.3300884272335906644002534449100494384765625e-10_4' is not a variable or pointer46 call vol_dum_real(3.141592653 * 10.6e-11)47 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_real=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]48 !BECAUSE: '-2.9637666816e10_4' is not a variable or pointer49 call vol_dum_real(3.141592653 / (-10.6e-11))50 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]51 !BECAUSE: '(1._4,3.2000000476837158203125_4)' is not a variable or pointer52 call vol_dum_complex((1., 3.2))53 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]54 !BECAUSE: '(-1._4,6.340000152587890625_4)' is not a variable or pointer55 call vol_dum_complex((1., 3.2) + (-2., 3.14))56 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]57 !BECAUSE: '(-1.2048000335693359375e1_4,-3.2599999904632568359375_4)' is not a variable or pointer58 call vol_dum_complex((1., 3.2) * (-2., 3.14))59 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_complex=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]60 !BECAUSE: '(5.80680549144744873046875e-1_4,-6.8833148479461669921875e-1_4)' is not a variable or pointer61 call vol_dum_complex((1., 3.2) / (-2., 3.14))62 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]63 !BECAUSE: '[INTEGER(4)::1_4,2_4,3_4,4_4]' is not a variable or pointer64 call vol_dum_int_arr((/ 1, 2, 3, 4 /))65 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]66 !BECAUSE: 'reshape([INTEGER(4)::1_4,2_4,3_4,4_4],shape=[2,2])' is not a variable or pointer67 call vol_dum_int_arr(reshape((/ 1, 2, 3, 4 /), (/ 2, 2/)))68 !WARNING: Actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not definable [-Wundefinable-asynchronous-or-volatile-actual]69 !BECAUSE: '[INTEGER(4)::1_4,2_4,3_4,4_4]' is not a variable or pointer70 call vol_dum_int_arr((/ 1, 2, 3, 4 /))71 end subroutine test_all_subprograms72end module m73