File tree Expand file tree Collapse file tree 5 files changed +46
-8
lines changed Expand file tree Collapse file tree 5 files changed +46
-8
lines changed Original file line number Diff line number Diff line change @@ -838,12 +838,9 @@ void ModFileWriter::PutUseExtraAttr(
838
838
839
839
static inline SourceName NameInModuleFile (const Symbol &symbol) {
840
840
if (const auto *use{symbol.detailsIf <UseDetails>()}) {
841
- if (use->symbol ().attrs ().test (Attr::PRIVATE)) {
842
- // Avoid the use in sorting of names created to access private
843
- // specific procedures as a result of generic resolution;
844
- // they're not in the cooked source.
845
- return use->symbol ().name ();
846
- }
841
+ // Avoid the use in sorting of names created to specific procedures as a
842
+ // result of generic resolution; they're not in the cooked source.
843
+ return use->symbol ().name ();
847
844
}
848
845
return symbol.name ();
849
846
}
Original file line number Diff line number Diff line change
1
+ module foo
2
+ interface do_foo
3
+ procedure do_foo_impl
4
+ end interface
5
+ interface do_bar
6
+ procedure do_bar_impl
7
+ end interface
8
+ contains
9
+ subroutine do_foo_impl ()
10
+ end
11
+ subroutine do_bar_impl ()
12
+ end
13
+ end
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ module m3
26
26
end
27
27
! Expect: m3.mod
28
28
! module m3
29
- ! use m2,only:y1
30
29
! use m2,only:z1=>x1
30
+ ! use m2,only:y1
31
31
! end
32
32
33
33
module m4
Original file line number Diff line number Diff line change @@ -154,9 +154,9 @@ module m1c
154
154
! Expect: m1c.mod
155
155
! module m1c
156
156
! use m1,only:myfoo=>foo
157
+ ! use m1,only:operator(+)
157
158
! use m1,only:operator(.bar.)
158
159
! use m1,only:operator(.mybar.)=>operator(.bar.)
159
- ! use m1,only:operator(+)
160
160
! end
161
161
162
162
module m2
Original file line number Diff line number Diff line change
1
+ ! This test verifies that both invocations produce a consistent order in the
2
+ ! generated `.mod` file. Previous versions of Flang exhibited non-deterministic
3
+ ! behavior due to pointers outside the cooked source being used to order symbols
4
+ ! in the `.mod` file.
5
+
6
+ ! RUN: rm -rf %t && mkdir -p %t
7
+ ! RUN: %flang_fc1 -fsyntax-only -J%t %S/Inputs/modfile72.f90
8
+ ! RUN: %flang_fc1 -fsyntax-only -J%t %s
9
+ ! RUN: cat %t/bar.mod | FileCheck %s
10
+
11
+ ! RUN: rm -rf %t && mkdir -p %t
12
+ ! RUN: %flang_fc1 -fsyntax-only -J%t %S/Inputs/modfile72.f90 %s
13
+ ! RUN: cat %t/bar.mod | FileCheck %s
14
+
15
+ module bar
16
+ use foo, only : do_foo
17
+ use foo, only : do_bar
18
+ contains
19
+ subroutine do_baz ()
20
+ call do_foo()
21
+ call do_bar()
22
+ end
23
+ end
24
+
25
+ ! CHECK: use foo,only:do_foo
26
+ ! CHECK-NEXT: use foo,only:do_bar
27
+ ! CHECK-NEXT: use foo,only:foo$foo$do_foo_impl=>do_foo_impl
28
+ ! CHECK-NEXT: use foo,only:foo$foo$do_bar_impl=>do_bar_impl
You can’t perform that action at this time.
0 commit comments