| 1 |
! { dg-do compile { target lto } } |
| 2 |
! { dg-additional-options "-flto" } |
| 3 |
|
| 4 |
! Same as allocate-13.f90 but compiled with -flto. |
| 5 |
|
| 6 |
! This was failing before as the statement list, |
| 7 |
! used for placing the GOMP_alloc/GOMP_free leaked |
| 8 |
! through to LTO. |
| 9 |
|
| 10 |
module m |
| 11 |
implicit none |
| 12 |
!$omp requires dynamic_allocators |
| 13 |
contains |
| 14 |
subroutine f () |
| 15 |
!$omp declare target |
| 16 |
integer :: var |
| 17 |
!$omp allocate(var) |
| 18 |
var = 5 |
| 19 |
end |
| 20 |
|
| 21 |
subroutine h () |
| 22 |
!$omp target |
| 23 |
!$omp parallel |
| 24 |
!$omp single |
| 25 |
block |
| 26 |
integer :: var2(5) |
| 27 |
!$omp allocate(var2) |
| 28 |
var2(1) = 7 |
| 29 |
end block |
| 30 |
!$omp end single |
| 31 |
!$omp end parallel |
| 32 |
!$omp end target |
| 33 |
end |
| 34 |
end module |