Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/public_private_module_8.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do compile } | |
2 ! { dg-options "-O2" } | |
3 ! | |
4 ! PR fortran/54884 | |
5 ! | |
6 ! Check that get_key_len is not optimized away as it | |
7 ! is used in a publicly visible specification expression. | |
8 ! | |
9 | |
10 module m | |
11 private | |
12 public :: foo | |
13 interface foo | |
14 module procedure bar | |
15 end interface foo | |
16 contains | |
17 pure function mylen() | |
18 integer :: mylen | |
19 mylen = 42 | |
20 end function mylen | |
21 pure function myotherlen() | |
22 integer :: myotherlen | |
23 myotherlen = 99 | |
24 end function myotherlen | |
25 subroutine bar(x) | |
26 character(len=mylen()) :: x | |
27 character :: z2(myotherlen()) | |
28 call internal(x) | |
29 block | |
30 character(len=myotherlen()) :: z | |
31 z = "abc" | |
32 x(1:5) = z | |
33 end block | |
34 x(6:10) = intern_func() | |
35 contains | |
36 function intern_func() | |
37 character(len=myotherlen()) :: intern_func | |
38 intern_func = "zuzu" | |
39 end function intern_func | |
40 subroutine internal(y) | |
41 character(len=myotherlen()) :: y | |
42 y = "abc" | |
43 end subroutine internal | |
44 end subroutine bar | |
45 end module m | |
46 | |
47 ! { dg-final { scan-assembler-not "__m_MOD_myotherlen" } } | |
48 ! { dg-final { scan-assembler "__m_MOD_bar" } } | |
49 ! { dg-final { scan-assembler "__m_MOD_mylen" } } |