[clang] [flang] [Flang][Driver] Add support for option -f[no-]split-machine-functions in flang (PR #216637)
Kaviya Rajendiran via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 18 23:24:46 PDT 2026
================
@@ -0,0 +1,16 @@
+! Test handling of -fsplit-machine-functions and -fno-split-machine-functions.
+
+! RUN: %if x86-registered-target %{ %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefix=NEG_FLAG %}
+! RUN: %if x86-registered-target %{ %flang -### --target=x86_64-unknown-linux-gnu -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=POS_FLAG %}
+! RUN: %if x86-registered-target %{ %flang -### --target=x86_64-unknown-linux-gnu -fno-split-machine-functions %s 2>&1 | FileCheck %s --check-prefix=NEG_FLAG %}
+! RUN: %if x86-registered-target %{ %flang -### --target=x86_64-unknown-linux-gnu -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s --check-prefix=NEG_FLAG %}
+! RUN: %if x86-registered-target %{ %flang -### --target=x86_64-unknown-linux-gnu -fno-split-machine-functions -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=POS_FLAG %}
+! RUN: %if arm-registered-target %{ not %flang -### --target=arm-unknown-linux-gnueabi -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=CHECK_ERROR %}
----------------
kaviya2510 wrote:
The target check runs only for the positive flag `-fsplit-machine-functions`. If the last matching arg is `-fno-split-machine-functions` nothing forwarded to `-fc1`. It is the same effect as default.
I will cover this case as well as a part of testcase.
https://github.com/llvm/llvm-project/pull/216637
More information about the cfe-commits
mailing list