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
13!--------------------------
14! -module-dir<value>
15!--------------------------
16! RUN: rm -rf %t && mkdir -p %t/dir-flang
17! RUN: cd %t && %flang -fsyntax-only -module-dir%t/dir-flang %s
18! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
19
20!---------------------------
21! -J <value>
22!---------------------------
23! RUN: rm -rf %t && mkdir -p %t/dir-flang
24! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
25! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
26
27!------------------------------
28! -J<value>
29!------------------------------
30! RUN: rm -rf %t && mkdir -p %t/dir-flang
31! RUN: cd %t && %flang -fsyntax-only -J%t/dir-flang %s
32! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
33
34module testmodule
35  type::t2
36  end type
37end
38