xref: /llvm-project/flang/test/Driver/write-module.f90 (revision 9a485b02f9e3184ae34e64dbadc2a17b787db007)
1! Checks that the module file:
2!   * is _saved_
3!   * is saved in the _directory specified by the user_
4! We use `-fsyntax-only` as it stops after the semantic checks (the module file is generated when sema checks are run)
5
6!--------------------------
7! -module-dir <value>
8!--------------------------
9! RUN: rm -rf %t && mkdir -p %t/dir-flang
10! RUN: cd %t && %flang -fsyntax-only -module-dir %t/dir-flang %s
11! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
12! RUN: cd -
13
14!--------------------------
15! -module-dir<value>
16!--------------------------
17! RUN: rm -rf %t && mkdir -p %t/dir-flang
18! RUN: cd %t && %flang -fsyntax-only -module-dir%t/dir-flang %s
19! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
20! RUN: cd -
21
22!---------------------------
23! -J <value>
24!---------------------------
25! RUN: rm -rf %t && mkdir -p %t/dir-flang
26! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
27! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
28! RUN: cd -
29
30!------------------------------
31! -J<value>
32!------------------------------
33! RUN: rm -rf %t && mkdir -p %t/dir-flang
34! RUN: cd %t && %flang -fsyntax-only -J%t/dir-flang %s
35! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
36! RUN: cd -
37
38module testmodule
39  type::t2
40  end type
41end
42