[clang] [NFC][clang][Driver] Add tests for --driver-mode=flang (PR #207658)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 08:09:55 PDT 2026


================
@@ -5,3 +5,10 @@
 ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/one.f90"
 ! CHECK-SYNTAX-ONLY-LABEL: "{{[^"]*}}clang{{[^"/]*}}" "-cc1"
 ! CHECK-SYNTAX-ONLY: "{{[^"]*}}/Inputs/other.c"
+
+! RUN: not %clang --driver-mode=flang -### -Xflang -std=f2018 %S/Inputs/one.f90 -Xclang -std=c17 %S/Inputs/other.c 2>&1 | FileCheck --check-prefixes=MIXED-OPT %s
+! MIXED-OPT: clang: error: unknown argument '-Xclang'
+! MIXED-OPT-NOT: "{{[^"]*}}flang{{[^"/]*}}" "-fc1"
+! MIXED-OPT-NOT: "-std=f2018"
+! MIXED-OPT-NOT: "{{[^"]*}}clang{{[^"/]*}}" "-cc1"
+! MIXED-OPT-NOT: "-std=c17"
----------------
tarunprabhu wrote:

Could you clarify the purpose of these checks? I don't understand why we need to check for the absence of `fc1` and `cc1` lines.

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


More information about the cfe-commits mailing list