File tree Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Expand file tree Collapse file tree 6 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1- ! RUN: %flang_fc1 -fsyntax-only -fhermetic-module-files -DSTEP=1 %s
2- ! RUN: %flang_fc1 -fsyntax-only -DSTEP=2 %s
3- ! RUN: not %flang_fc1 -fsyntax-only -pedantic %s 2>&1 | FileCheck %s
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang_fc1 -fsyntax-only -fhermetic-module-files -DSTEP=1 -J%t %s
3+ ! RUN: %flang_fc1 -fsyntax-only -DSTEP=2 -J%t %s
4+ ! RUN: not %flang_fc1 -fsyntax-only -pedantic -J%t %s 2>&1 | FileCheck %s
45
56! Tests that a module captured in a hermetic module file is compatible when
67! USE'd with a module of the same name USE'd directly.
Original file line number Diff line number Diff line change 1- ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 %s && %flang -c -fhermetic-module-files -DWHICH=2 %s && %flang_fc1 -fdebug-unparse %s | FileCheck %s
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 -J%t %s && %flang -c -fhermetic-module-files -DWHICH=2 -J%t %s && %flang_fc1 -fdebug-unparse -J%t %s | FileCheck %s
23
34#if WHICH == 1
45module modfile75a
Original file line number Diff line number Diff line change 1- ! RUN: %flang_fc1 -fsyntax-only -fhermetic-module-files -DSTEP=1 %s
2- ! RUN: %flang_fc1 -fsyntax-only %s
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang_fc1 -fsyntax-only -fhermetic-module-files -DSTEP=1 -J%t %s
3+ ! RUN: %flang_fc1 -fsyntax-only -J%t %s
34
45! Tests that a BIND(C) variable in a module A captured in a hermetic module
56! file USE'd in a module B is not creating bogus complaints about BIND(C) name
67! conflict when both module A and B are later accessed.
78
89#if STEP == 1
9- module modfile75a
10+ module modfile76a
1011 integer , bind(c) :: x
1112end
1213
13- module modfile75b
14- use modfile75a ! capture hermetically
14+ module modfile76b
15+ use modfile76a ! capture hermetically
1516end
1617
1718#else
1819subroutine test
19- use modfile75a
20- use modfile75b
20+ use modfile76a
21+ use modfile76b
2122 implicit none
2223 print * , x
2324end subroutine
Original file line number Diff line number Diff line change 1- ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 %s && %flang -c -fhermetic-module-files -DWHICH=2 %s && %flang -c -fhermetic-module-files %s && cat modfile77c.mod | FileCheck %s
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 -J%t %s && %flang -c -fhermetic-module-files -DWHICH=2 -J%t %s && %flang -c -fhermetic-module-files -J%t %s && cat %t/modfile77c.mod | FileCheck %s
23
34#if WHICH == 1
45module modfile77a
Original file line number Diff line number Diff line change 1- ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 %s && %flang -c -fhermetic-module-files -DWHICH=2 %s && %flang -c -fhermetic-module-files %s && cat modfile78c.mod | FileCheck %s
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang -c -fhermetic-module-files -DWHICH=1 -J%t %s && %flang -c -fhermetic-module-files -DWHICH=2 -J%t %s && %flang -c -fhermetic-module-files -J%t %s && cat %t/modfile78c.mod | FileCheck %s
23
34#if WHICH == 1
45module modfile78a
Original file line number Diff line number Diff line change 1- ! RUN: %flang -c -DWHICH=1 %s && FileCheck %s <modfile79a.mod && %flang -c -fhermetic-module-files -DWHICH=2 %s && %flang -c %s && FileCheck %s <modfile79a.mod
1+ ! RUN: rm -rf %t && mkdir -p %t
2+ ! RUN: %flang -c -DWHICH=1 -J%t %s && FileCheck %s <%t/modfile79a.mod && %flang -c -fhermetic-module-files -DWHICH=2 -J%t %s && %flang -c -J%t %s && FileCheck %s <%t/modfile79a.mod
23
34! Ensure that writing modfile79c.mod doesn't cause a spurious
45! regeneration of modfile79a.mod from its copy in the hermetic
You can’t perform that action at this time.
0 commit comments