URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [allocatable_function_4.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do compile }! { dg-options "-fdump-tree-original" }!! PR fortran/37626! Contributed by Rich Townsend!! The problem was an ICE when trying to deallocate the! result variable "x_unique".!function unique_A (x, sorted) result (x_unique)implicit nonecharacter(*), dimension(:), intent(in) :: xlogical, intent(in), optional :: sortedcharacter(LEN(x)), dimension(:), allocatable :: x_uniquelogical :: sorted_character(LEN(x)), dimension(SIZE(x)) :: x_sortedinteger :: n_xlogical, dimension(SIZE(x)) :: maskinteger, external :: b3ss_index! Set up sorted_if(PRESENT(sorted)) thensorted_ = sortedelsesorted_ = .FALSE.endif! If necessary, sort xif(sorted_) thenx_sorted = xelsex_sorted = x(b3ss_index(x))endif! Set up the unique arrayn_x = SIZE(x)mask = (/.TRUE.,x_sorted(2:n_x) /= x_sorted(1:n_x-1)/)allocate(x_unique(COUNT(mask)))x_unique = PACK(x_sorted, MASK=mask)! Finishreturnend function unique_A! { dg-final { scan-tree-dump-times "__builtin_free" 5 "original" } }! { dg-final { cleanup-tree-dump "original" } }
