| 1 |
! PR fortran/89651 |
| 2 |
! { dg-do compile } |
| 3 |
! { dg-additional-options "-Wuninitialized" } |
| 4 |
|
| 5 |
program pr89651 |
| 6 |
integer :: n |
| 7 |
real, allocatable :: t(:) |
| 8 |
n = 10 |
| 9 |
allocate (t(n), source = 0.0) |
| 10 |
!$omp parallel firstprivate(t) |
| 11 |
print *, sum (t) ! { dg-bogus "lbound' may be used uninitialized in this function" } |
| 12 |
! { dg-bogus "ubound' may be used uninitialized in this function" "" { target *-*-* } .-1 } |
| 13 |
! { dg-bogus "offset' may be used uninitialized in this function" "" { target *-*-* } .-2 } |
| 14 |
!$omp end parallel |
| 15 |
!$omp parallel private(t) |
| 16 |
t = 0.0 |
| 17 |
print *, sum (t) ! { dg-bogus "lbound' may be used uninitialized in this function" } |
| 18 |
! { dg-bogus "ubound' may be used uninitialized in this function" "" { target *-*-* } .-1 } |
| 19 |
! { dg-bogus "offset' may be used uninitialized in this function" "" { target *-*-* } .-2 } |
| 20 |
!$omp end parallel |
| 21 |
end program pr89651 |