[PATCH] D126291: [flang][Driver] Update link job on windows
Diana Picus via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 14 03:05:14 PDT 2022
rovka added inline comments.
================
Comment at: flang/test/Driver/linker-flags.f90:51
+! MSVC-NOT: libcmt
+! MSVC-NOT: oldnames
+! MSVC-SAME: "[[object_file]]"
----------------
awarzynski wrote:
> rovka wrote:
> > mmuetzel wrote:
> > > Lines 50-51 seem to be duplicates of lines 44-45. Is this intentional?
> > Yes, I don't want those to appear either before or after the Fortran libs. I guess if we wanted to be pedantic we'd also check that they don't appear after the object_file, or between the libs and the subsystem, but that seems a bit much.
> Based on the [[ https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-same-directive | docs ]], I'd say that this would be the idiomatic way to do this:
> ```lang=bash
> ! MSVC-LABEL:
> ! MSVC-NOT:
> ! MSVC-SAME:
> ```
> IIUC, the following would only be needed if there's a potential for `libcmt` or `oldnames` to appear on a separate line:
> ```
> ```lang=bash
> ! MSVC-LABEL:
> ! MSVC-NOT:
> ! MSVC-SAME:
> ! MSVC-NOT:
> ```
> But this wouldn't happen, right? (there's going to be only one linker invocation). Also, you could just use [[ https://llvm.org/docs/CommandGuide/FileCheck.html#options | --implicit-check-not ]] :)
> Based on the [[ https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-same-directive | docs ]], I'd say that this would be the idiomatic way to do this:
> ```lang=bash
> ! MSVC-LABEL:
> ! MSVC-NOT:
> ! MSVC-SAME:
> ```
Based on the same docs, I would say it shouldn't be enough to mention it just once. But that's just what I expect, the docs are completely unhelpful about the actual behaviour here. For instance, I would expect to be able to write
```
! MSVC-NOT: should-only-come-after-X
! MSVC-SAME: X
```
If the MSVC-NOT applies to the whole line, then lines with 'X should-come-after-X' get rejected, but imo they should be accepted (I'll admit I didn't actually verify this, and anyway the implicit-check-not makes the whole discussion moot).
> IIUC, the following would only be needed if there's a potential for `libcmt` or `oldnames` to appear on a separate line:
> ```
> ```lang=bash
> ! MSVC-LABEL:
> ! MSVC-NOT:
> ! MSVC-SAME:
> ! MSVC-NOT:
> ```
I agree that if there's no MSVC-SAME after the last MSVC-NOT, then the MSVC-NOT would apply to the following line.
> But this wouldn't happen, right? (there's going to be only one linker invocation). Also, you could just use [[ https://llvm.org/docs/CommandGuide/FileCheck.html#options | --implicit-check-not ]] :)
Wooow 😍 I didn't know about that one, I'll definitely update the test to use it, thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126291/new/
https://reviews.llvm.org/D126291
More information about the cfe-commits
mailing list