Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / public_private_module_7.f90
blobd03b7047a126aed151eeae0a5abe7a658df967ba
1 ! { dg-do compile }
2 ! { dg-options "-O2" }
4 ! PR fortran/54884
6 ! Check that get_key_len is not optimized away as it
7 ! is used in a publicly visible specification expression.
9 module m_common_attrs
10 private
11 !...
12 public :: get_key
13 contains
14 pure function get_key_len() result(n)
15 n = 5
16 end function get_key_len
17 pure function other() result(n)
18 n = 5
19 end function other
20 ! ...
21 function get_key() result(key)
22 ! ...
23 character(len=get_key_len()) :: key
24 key = ''
25 end function get_key
26 end module m_common_attrs
28 ! { dg-final { scan-assembler-not "__m_common_attrs_MOD_other" } }
29 ! { dg-final { scan-assembler "__m_common_attrs_MOD_get_key_len" } }