[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_alias.f90
blob99b97a61a4807f4e6bcd41c099e25f8bc603467e
1 ! { dg-do compile }
2 ! { dg-options "-Waliasing" }
4 ! PR fortran/57991
6 ! Added check for OUT/OUT. IN/OUT and OUT/IN where already check
7 ! since GCC 4.0, but not being tested for.
9 Program q
10 integer :: x
11 x = 5
12 Call test1(x, x) ! { dg-warning "Same actual argument associated with INTENT.OUT. argument 'a' and INTENT.OUT. argument 'b'" }
13 Call test2(x, x) ! { dg-warning "Same actual argument associated with INTENT.IN. argument 'a' and INTENT.OUT. argument 'b'" }
14 Call test3(x, x) ! { dg-warning "Same actual argument associated with INTENT.OUT. argument 'a' and INTENT.IN. argument 'b'" }
15 Contains
16 Subroutine test1(a,b)
17 Integer, intent(out) :: a
18 Integer, intent(out) :: b
19 b = 5
20 a = 5
21 End Subroutine
22 Subroutine test2(a,b)
23 Integer, intent(in) :: a
24 Integer, intent(out) :: b
25 b = 5 + a
26 End Subroutine
27 Subroutine test3(a,b)
28 Integer, intent(out) :: a
29 Integer, intent(in) :: b
30 a = 5 + b
31 End Subroutine
32 End Program