xref: /llvm-project/flang/test/Semantics/intrinsics02.f90 (revision 5a402c56226e9b50bffdedd19d2acb8b61b408a3)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2module explicit
3  intrinsic cos
4end
5subroutine testExplicit
6  use explicit
7  !ERROR: 'cos' is use-associated from module 'explicit' and cannot be re-declared
8  real :: cos = 2.
9end
10subroutine extendsUsedIntrinsic
11  use explicit
12  interface cos
13    pure real function mycos(x)
14      real, intent(in) :: x
15    end
16  end interface
17end
18subroutine sameIntrinsic1
19  use explicit
20  !WARNING: Use-associated 'cos' already has 'INTRINSIC' attribute
21  intrinsic cos
22  real :: one = cos(0.)
23end
24module renamer
25  use explicit, renamedCos => cos
26end
27subroutine sameIntrinsic2
28  use explicit
29  use renamer, cos => renamedCos
30  real :: one = cos(0.)
31end
32module implicit
33  real :: one = cos(0.)
34end
35subroutine testImplicit
36  use implicit
37  real :: cos = 2.
38end
39