https://github.com/yus3710-fj created 
https://github.com/llvm/llvm-project/pull/207658

This patch intends to clarify the current behaviors, not to state the 
expected/desirable behaviors.

>From 8bc4dcbfbb148733cede4e395240c7cf9e2cd261 Mon Sep 17 00:00:00 2001
From: Yusuke MINATO <[email protected]>
Date: Fri, 26 Jun 2026 13:08:04 +0900
Subject: [PATCH] [NFC][clang] Add tests for --driver-mode=flang

This patch intends to clarify the current behaviors,
not to state the expected/desirable behaviors.
---
 clang/test/Driver/flang/multiple-inputs-mixed.f90 | 7 +++++++
 clang/test/Driver/flang/runtimes.f90              | 8 ++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 clang/test/Driver/flang/runtimes.f90

diff --git a/clang/test/Driver/flang/multiple-inputs-mixed.f90 
b/clang/test/Driver/flang/multiple-inputs-mixed.f90
index 98d8cab00bdfd..25321cd1fcf02 100644
--- a/clang/test/Driver/flang/multiple-inputs-mixed.f90
+++ b/clang/test/Driver/flang/multiple-inputs-mixed.f90
@@ -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"
diff --git a/clang/test/Driver/flang/runtimes.f90 
b/clang/test/Driver/flang/runtimes.f90
new file mode 100644
index 0000000000000..7300bba75e2da
--- /dev/null
+++ b/clang/test/Driver/flang/runtimes.f90
@@ -0,0 +1,8 @@
+! Check that Flang runtimes are passed to the linker in --driver-mode=flang.
+
+! RUN: %clang --driver-mode=flang --rtlib=compiler-rt -### %s 2>&1 | FileCheck 
%s
+! CHECK-DAG: clang_rt.{{[^ "]}}
+! CHECK-DAG: flang_rt.{{[^ "]}}
+
+! RUN: not %clang --driver-mode=flang -stdlib=libc++ -### %s 2>&1 | FileCheck 
--check-prefix=LIBCXX %s
+! LIBCXX: clang: error: unknown argument: '-stdlib=libc++'

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to