[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

Andrzej Warzyński via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 00:25:15 PST 2023


================
@@ -0,0 +1,15 @@
+! DEFINE: %{triple} =
+! DEFINE: %{run} = %flang_fc1 -emit-mlir -triple %{triple} --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s
+! REDEFINE: %{triple} = aarch64-pc-windows-msvc
+! RUN: %{run}
+! REDEFINE: %{triple} = x86_64-pc-windows-msvc
+! RUN: %{run}
+! REDEFINE: %{triple} = x86_64-linux-unknown-gnu
+! RUN: not %{run} --check-prefixes=CHECK-NOWIN
+! REDEFINE: %{triple} = aarch64-apple-darwin
+! RUN: not %{run} --check-prefixes=CHECK-NOWIN
----------------
banach-space wrote:

I see what you meant about readability - indeed debatable 😅 . Here's an idea how to improve it a bit:

```suggestion
! DEFINE: %{triple} =
! DEFINE: %{compile} = %flang_fc1 -emit-mlir -triple %{triple} --dependent-lib=libtest %s -o - 2>&1

! REDEFINE: %{triple} = aarch64-pc-windows-msvc
! RUN: %{compile}  | FileCheck %s

! REDEFINE: %{triple} = x86_64-pc-windows-msvc
! RUN: %{compile}  | FileCheck %s

! REDEFINE: %{triple} = x86_64-linux-unknown-gnu
! RUN: not %{compile}  | FileCheck %s --check-prefixes=CHECK-NOWIN

! REDEFINE: %{triple} = aarch64-apple-darwin
! RUN: not %{compile}  | FileCheck %s --check-prefixes=CHECK-NOWIN
```
(separating the compiler invocation from the FileCheck invocation as two logically seperate things).

This is a "nit" - I am happy with this test as long as the functionality is verified (it is).

https://github.com/llvm/llvm-project/pull/72121


More information about the cfe-commits mailing list