3 ! { dg-additional-options -Wuninitialized }
8 pure
subroutine add_ps_routine(a
, b
, c
)
11 integer, intent(in
) :: a
, b
12 integer, intent(out
) :: c
13 integer, parameter :: n
= 10
21 end subroutine add_ps_routine
23 elemental impure
function add_ef(a
, b
) result(c
)
26 integer, intent(in
) :: a
, b
29 call add_ps_routine(a
, b
, c
)
31 ! This '-Wmaybe-uninitialized' diagnostic appears for '-O2' only; PR102192.
32 ! { dg-xfail-if PR102192 { *-*-* } { -O2 } }
33 ! There's another instance (again '-O2' only) further down, but as any number
34 ! of 'dg-xfail-if' only apply to the first 'dg-bogus' etc., we have no way to
35 ! XFAIL that other one, so we instead match all of them here (via line '0'):
36 ! { dg-bogus {'c' may be used uninitialized} {} { target *-*-* } 0 }
37 ! { TODO_dg-bogus {'c' may be used uninitialized} {} { target *-*-* } .-7 }
43 integer, parameter :: n
= 10
44 integer, dimension(n
) :: a_a
45 integer, dimension(n
) :: b_a
46 integer, dimension(n
) :: c_a
49 a_a
= [(3 * i
, i
= 1, n
)]
50 b_a
= [(-2 * i
, i
= 1, n
)]
51 !$acc parallel copyin(a_a, b_a) copyout(c_a)
55 c_a
= add_ef(a_a
, b_a
)
57 ! { TODO_dg-xfail-if PR102192 { *-*-* } { -O2 } }
58 ! { TODO_dg-bogus {'c' may be used uninitialized} {} { target *-*-* } .-3 }
62 if (any (c_a
/= [(i
, i
=1, 10)])) stop 1