[flang-commits] [flang] [flang] Make gcc-triple.f90 unsupported on Darwin (PR #171690)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Wed Dec 10 13:06:15 PST 2025


https://github.com/luporl updated https://github.com/llvm/llvm-project/pull/171690

>From f71a44e11a09cc9734c9718847ecadf3ac427950 Mon Sep 17 00:00:00 2001
From: Leandro Lupori <leandro.lupori at linaro.org>
Date: Wed, 10 Dec 2025 17:11:42 -0300
Subject: [PATCH 1/2] [flang] Make gcc-triple.f90 unsupported on Darwin

It fails with the following error:

```
RUN: at line 13
/Users/leandro.lupori/home/git/flang/build/bin/flang -v --sysroot=/Users/leandro.lupori/home/git/flang/llvm-project/flang/test/Driver/Inputs/fedora_39_tree --gcc-triple=x86_64-redhat-linux 2>&1 | /Users/leandro.lupori/home/git/flang/build/bin/FileCheck /Users/leandro.lupori/home/git/flang/llvm-project/flang/test/Driver/gcc-triple.f90 --check-prefix=TRIPLE_EXISTS
.---command stderr------------
| /Users/leandro.lupori/home/git/flang/llvm-project/flang/test/Driver/gcc-triple.f90:14:18: error: TRIPLE_EXISTS: expected string not found in input
| ! TRIPLE_EXISTS: {{^}}Selected GCC installation:
|                  ^
| ...
| Input was:
| <<<<<<
|             1: flang version 22.0.0git (git at github.com:llvm/llvm-project.git dde1990b01fa13087b0eab77579f528329555968)
| check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
|             2: Target: arm64-apple-darwin24.6.0
| check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|             3: Thread model: posix
| check:14'0     ~~~~~~~~~~~~~~~~~~~~
|             4: InstalledDir: /Users/leandro.lupori/home/git/flang/build/bin
| check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|             5: Build config: +assertions
| check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
|             6: flang-22: warning: argument unused during compilation: '--gcc-triple=x86_64-redhat-linux' [-Wunused-command-line-argument]
| check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| >>>>>>
`-----------------------------
```
---
 flang/test/Driver/gcc-triple.f90 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang/test/Driver/gcc-triple.f90 b/flang/test/Driver/gcc-triple.f90
index 3aacb84bfd227..145648ea5d8e7 100644
--- a/flang/test/Driver/gcc-triple.f90
+++ b/flang/test/Driver/gcc-triple.f90
@@ -1,4 +1,4 @@
-!! UNSUPPORTED: system-windows, system-aix
+!! UNSUPPORTED: system-windows, system-aix, system-darwin
 
 !! Test that --gcc-triple option is working as expected.
 
@@ -15,4 +15,4 @@
 ! TRIPLE_EXISTS: fedora_39_tree/usr/lib/gcc/x86_64-redhat-linux/13
 
 ! RUN: %flang -v --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-foo-linux 2>&1 | FileCheck %s --check-prefix=TRIPLE_DOES_NOT_EXISTS
-! TRIPLE_DOES_NOT_EXISTS-NOT: x86_64-foo-linux
\ No newline at end of file
+! TRIPLE_DOES_NOT_EXISTS-NOT: x86_64-foo-linux

>From f3b808e3509c9c5dec88738c0fd7582787a3cd18 Mon Sep 17 00:00:00 2001
From: Leandro Lupori <leandro.lupori at linaro.org>
Date: Wed, 10 Dec 2025 18:05:03 -0300
Subject: [PATCH 2/2] Add an explicit target to RUN commands

---
 flang/test/Driver/gcc-triple.f90 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/flang/test/Driver/gcc-triple.f90 b/flang/test/Driver/gcc-triple.f90
index 145648ea5d8e7..95a0b3b375f17 100644
--- a/flang/test/Driver/gcc-triple.f90
+++ b/flang/test/Driver/gcc-triple.f90
@@ -1,4 +1,4 @@
-!! UNSUPPORTED: system-windows, system-aix, system-darwin
+!! UNSUPPORTED: system-windows, system-aix
 
 !! Test that --gcc-triple option is working as expected.
 
@@ -10,9 +10,9 @@
 ! DEFAULT_TRIPLE: {{^}}Selected GCC installation:
 ! DEFAULT_TRIPLE: fedora_39_tree/usr/lib/gcc/x86_64-linux-gnu/13
 
-! RUN: %flang -v --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-redhat-linux 2>&1 | FileCheck %s --check-prefix=TRIPLE_EXISTS
+! RUN: %flang --target=x86_64-redhat-linux-gnu -v --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-redhat-linux 2>&1 | FileCheck %s --check-prefix=TRIPLE_EXISTS
 ! TRIPLE_EXISTS: {{^}}Selected GCC installation:
 ! TRIPLE_EXISTS: fedora_39_tree/usr/lib/gcc/x86_64-redhat-linux/13
 
-! RUN: %flang -v --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-foo-linux 2>&1 | FileCheck %s --check-prefix=TRIPLE_DOES_NOT_EXISTS
+! RUN: %flang --target=x86_64-redhat-linux-gnu -v --sysroot=%S/Inputs/fedora_39_tree --gcc-triple=x86_64-foo-linux 2>&1 | FileCheck %s --check-prefix=TRIPLE_DOES_NOT_EXISTS
 ! TRIPLE_DOES_NOT_EXISTS-NOT: x86_64-foo-linux



More information about the flang-commits mailing list