[flang-commits] [clang] [flang] [Flang][Driver] Support for -fsplit-lto-unit option in flang driver (PR #202858)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Tue Jun 16 06:59:59 PDT 2026


================
@@ -0,0 +1,18 @@
+! Check that -fsplit-lto-unit is passed to fc1 by the driver
+! RUN: %flang -### -fsplit-lto-unit %s 2>&1 | FileCheck %s --check-prefixes=CHECK-FC1,CHECK-OPTION
----------------
tarunprabhu wrote:

You don't need a separate check prefix for `-fc1`. In fact, it's the exact opposite. You want to ensure that `-fsplit-lto-unit` is on the same line as `fc1`. It may be better, and clearer to do the following instead
```
... | FileCheck --check-prefix=SPLIT

SPLIT: "-fc1"
SPLIT-SAME: "-fsplit-lto-unit"
```
For the case where the option is not expected to be passed, you could then do
```
... | FileCheck --check-prefix=NO-SPLIT

NO-SPLIT-NOT: "-fsplit-lto-unit"
```
You know that the string should not appear at all, so there is no need to match anything else.

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


More information about the flang-commits mailing list