xref: /llvm-project/flang/test/Semantics/resolve121.f90 (revision e7b8e18fc359c0de380e89b27898d18913ca9c50)
1! Check that symbols without SAVE attribute from an EQUIVALENCE
2! with at least one symbol being SAVEd (explicitly or implicitly)
3! have implicit SAVE attribute.
4!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
5
6subroutine test1()
7  ! CHECK-LABEL: Subprogram scope: test1
8  ! CHECK: i1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4) init:1_4
9  ! CHECK: j1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
10  integer :: i1 = 1
11  integer :: j1
12  equivalence(i1,j1)
13end subroutine test1
14
15subroutine test2()
16  ! CHECK-LABEL: Subprogram scope: test2
17  ! CHECK: i1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4) init:1_4
18  ! CHECK: j1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
19  integer :: i1 = 1
20  integer :: j1
21  equivalence(j1,i1)
22end subroutine test2
23
24subroutine test3()
25  ! CHECK-LABEL: Subprogram scope: test3
26  ! CHECK: i1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
27  ! CHECK: j1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
28  ! CHECK: k1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
29  integer :: i1
30  integer :: j1, k1
31  common /blk/ k1
32  save /blk/
33  equivalence(i1,j1,k1)
34end subroutine test3
35
36subroutine test4()
37  ! CHECK-LABEL: Subprogram scope: test4
38  ! CHECK: i1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4) init:1_4
39  ! CHECK: j1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
40  ! CHECK: k1, SAVE size=4 offset=0: ObjectEntity type: INTEGER(4)
41  integer :: i1 = 1
42  integer :: j1, k1
43  common /blk/ k1
44  equivalence(i1,j1,k1)
45end subroutine test4
46