[PATCH] D96344: [flang][driver] Add options for -fdefault* and -flarge-sizes
Tim Keith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 12:03:26 PST 2021
tskeith added inline comments.
================
Comment at: flang/test/Flang-Driver/fdefault.f90:10
+! RUN: not %flang-new -fsyntax-only -fdefault-double-8 %s 2>&1 | FileCheck %s --check-prefix=DOUBLE
+! RUN: mkdir -p %t/dir-flang-new && %flang-new -fsyntax-only -module-dir %t/dir-flang-new -fdefault-real-8 %s 2>&1
+! RUN: cat %t/dir-flang-new/m.mod | grep 'real_kind=8_4'
----------------
awarzynski wrote:
> tskeith wrote:
> > I don't think you need to create a subdirectory. `%t` is a temp directory specific to this test.
> >
> > So I'm suggesting:
> > ```
> > ! RUN: %flang -fsyntax-only -fdefault-real-8 %s
> > ```
> From [[ https://llvm.org/docs/CommandGuide/lit.html#substitutions | LIT docs ]]:
>
> ```
> %t temporary file name unique to the test
> %T parent directory of %t (not unique, deprecated, do not use)
> ```
>
> So, IIUC, we do need to create a directory. We could skip `<dir-flang-new>` in the directory name, but it does no harm and can be really helpful when parsing CI logs.
>
> I might be missing something though. @tskeith ?
I thought lit created an empty directory for `%t` but apparently not. You just get whatever was left over from last run. So the safest thing to do is this for each compilation command:
`! RUN: rm -rf %t && mkdir %t && %flang -module-dir %t ...`
It's true that adding an extra subdirectory does no harm besides clutter, but what's the benefit?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96344/new/
https://reviews.llvm.org/D96344
More information about the cfe-commits
mailing list