53 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Check for semantic errors in ishftc() function calls3 4program test_ishftc5 use iso_fortran_env, only: int8, int16, int32, int646 implicit none7 8 integer :: n9 integer, allocatable :: array_result(:)10 integer, parameter :: const_arr1(2) = [-3,3]11 integer, parameter :: const_arr2(2) = [3,0]12 integer(kind=8), parameter :: const_arr3(2) = [0,4]13 integer(kind=int8), parameter :: const_arr4(2) = [0,4]14 integer(kind=int16), parameter :: const_arr5(2) = [0,4]15 integer(kind=int32), parameter :: const_arr6(2) = [0,4]16 integer(kind=int64), parameter :: const_arr7(2) = [0,4]17 18 n = ishftc(3, 2, 3)19 array_result = ishftc([3,3], [2,2], [3,3])20 21 !ERROR: SIZE=-3 count for ishftc is not positive22 n = ishftc(3, 2, -3)23 !ERROR: SIZE=0 count for ishftc is not positive24 n = ishftc(3, 2, 0)25 !ERROR: SHIFT=2 count for ishftc is greater in magnitude than SIZE=126 n = ishftc(3, 2, 1)27 !ERROR: SHIFT=-2 count for ishftc is greater in magnitude than SIZE=128 n = ishftc(3, -2, 1)29 !ERROR: SHIFT=4 count for ishftc is greater in magnitude than SIZE=330 array_result = ishftc(666, [(j,integer::j=1,5)], 3)31 !ERROR: SHIFT=4 count for ishftc is greater in magnitude than SIZE=332 array_result = ishftc(666, 4, [(j,integer::j=10,3,-1)])33 !ERROR: SIZE=-3 count for ishftc is not positive34 array_result = ishftc([3,3], [2,2], [-3,3])35 !ERROR: SIZE=-3 count for ishftc is not positive36 array_result = ishftc([3,3], [2,2], [-3,-3])37 !ERROR: SIZE=-3 count for ishftc is not positive38 array_result = ishftc([3,3], [-2,-2], const_arr1)39 !ERROR: SIZE=0 count for ishftc is not positive40 array_result = ishftc([3,3], [-2,-2], const_arr2)41 !ERROR: SIZE=0 count for ishftc is not positive42 array_result = ishftc([3,3], [-2,-2], const_arr3)43 !ERROR: SIZE=0 count for ishftc is not positive44 array_result = ishftc([3,3], [-2,-2], const_arr4)45 !ERROR: SIZE=0 count for ishftc is not positive46 array_result = ishftc([3,3], [-2,-2], const_arr5)47 !ERROR: SIZE=0 count for ishftc is not positive48 array_result = ishftc([3,3], [-2,-2], const_arr6)49 !ERROR: SIZE=0 count for ishftc is not positive50 array_result = ishftc([3,3], [-2,-2], const_arr7)51 array_result = ishftc([(j,integer::j=1,0)], 10, 9) ! ok because empty52end program test_ishftc53