coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr58290.f90
blobb19cdde05c6aed30941eae581d75c922df72d116
1 ! PR ipa/58290
2 ! { dg-do compile }
3 ! { dg-options "-O1 -fipa-pta" }
5 MODULE pr58290
6 TYPE b
7 CHARACTER(10) :: s = ''
8 END TYPE b
9 TYPE c
10 TYPE(b) :: d
11 END TYPE c
12 TYPE h
13 INTEGER, DIMENSION(:), POINTER :: b
14 END TYPE h
15 CONTAINS
16 SUBROUTINE foo(x, y)
17 LOGICAL, INTENT(IN) :: x
18 TYPE(c), INTENT(INOUT) :: y
19 END SUBROUTINE
20 FUNCTION bar (g) RESULT (z)
21 TYPE(h), INTENT(IN) :: g
22 TYPE(c) :: y
23 CALL foo (.TRUE., y)
24 z = SIZE (g%b)
25 END FUNCTION bar
26 SUBROUTINE baz (g)
27 TYPE(h), INTENT(INOUT) :: g
28 INTEGER :: i, j
29 j = bar(g)
30 DO i = 1, j
31 ENDDO
32 END SUBROUTINE baz
33 END MODULE