| 1 |
! { dg-additional-options "-Wuninitialized -O0" } |
| 2 |
! |
| 3 |
! PR fortran/93464 |
| 4 |
! |
| 5 |
! Contributed by G. Steinmetz |
| 6 |
! |
| 7 |
! Did before ICE in gfc_omp_check_optional_argument |
| 8 |
|
| 9 |
! Additionally, check for uninitialized warnings. There are |
| 10 |
! none with -O (cf. original testcase file 'pr93464.f90'). |
| 11 |
! For -O0, see below: |
| 12 |
|
| 13 |
program p |
| 14 |
character :: c(2) = 'a' |
| 15 |
character, allocatable :: z(:) |
| 16 |
! { dg-note {'z' declared here} {} { target *-*-* } .-1 } |
| 17 |
!$acc parallel |
| 18 |
! { dg-warning {'z\.dim\[0\]\.ubound' may be used uninitialized} {} { target *-*-* } .-1 } |
| 19 |
! { dg-warning {'z\.dim\[0\]\.lbound' may be used uninitialized} {} { target *-*-* } .-2 } |
| 20 |
!$omp target |
| 21 |
! Remark: As run-time check, required either 'c' being allocated or if(allocated(c)': |
| 22 |
z = c |
| 23 |
!$acc end parallel |
| 24 |
!$omp end target |
| 25 |
print *, z |
| 26 |
end |