2 ! This tests the fix for PRs 26834, 25669 and 18803, in which
3 ! shape information for the lbound and ubound intrinsics was not
4 ! transferred to the scalarizer. For this reason, an ICE would
5 ! ensue, whenever these functions were used in temporaries.
7 ! The tests are lifted from the PRs and some further checks are
8 ! done to make sure that nothing is broken.
11 subroutine gfcbug34 ()
14 integer, pointer :: i (:) => NULL ()
18 write(*,*) 'ubound:', ubound (gf
% i
)
19 write(*,*) 'lbound:', lbound (gf
% i
)
20 end subroutine gfcbug34
25 call bar (a
, LBOUND(a
),2)
27 subroutine bar (b
, i
, j
)
39 ! This checks that lbound and ubound are OK in temporary
41 subroutine io_bug_plus()
42 integer :: a(10, 10), b(2)
43 print *, ubound(a
)*(/1,2/)
44 print *, (/1,2/)*ubound(a
)
45 end subroutine io_bug_plus
47 character(4) :: ch(2), ech(2) = (/'ABCD', 'EFGH'/)
49 equivalence (ech
,a
) ! { dg-warning "default CHARACTER EQUIVALENCE statement" }
50 integer(1) :: i(8) = (/(j
, j
= 1,8)/)
52 ! Check that the bugs have gone
55 call foo ((/1.0,2.0,3.0/))
58 ! Check that we have not broken other intrinsics.
59 print *, cos ((/1.0,2.0/))
60 print *, transfer (a
, ch
)
61 print *, i(1:4) * transfer (a
, i
, 4) * 2