[flang-commits] [flang] [flang] Fix ISO_Fortran_binding.h to work better with C++ code (PR #82556)

via flang-commits flang-commits at lists.llvm.org
Wed Feb 21 16:25:31 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 22cf983387e52e3df01504c69df8266e9d80d9da dbfa4c1664bcb8632b4499c37db56ff2289434c1 -- flang/test/Driver/iso-fortran-binding.cpp flang/include/flang/ISO_Fortran_binding.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/test/Driver/iso-fortran-binding.cpp b/flang/test/Driver/iso-fortran-binding.cpp
index f977451c72..1b8189085b 100644
--- a/flang/test/Driver/iso-fortran-binding.cpp
+++ b/flang/test/Driver/iso-fortran-binding.cpp
@@ -1,13 +1,14 @@
-! UNSUPPORTED: system-windows
-! RUN: split-file %s %t
-! RUN: chmod +x %t/runtest.sh
-! RUN: %t/runtest.sh %t %t/cppfile.cpp %flang | FileCheck %s
+!UNSUPPORTED : system -
+        windows !RUN : split - file % s % t !RUN : chmod +
+                       x % t / runtest.sh !RUN : % t / runtest.sh % t % t /
+                                                 cppfile.cpp % flang |
+    FileCheck %
+        s
 
-!--- cppfile.cpp
-extern "C" {
+        !-- -cppfile.cpp extern "C" {
 #include "ISO_Fortran_binding.h"
 }
-#include<iostream>
+#include <iostream>
 
 int main() {
   std::cout << "PASS\n";
@@ -15,18 +16,11 @@ int main() {
 }
 
 // CHECK: PASS
-!--- runtest.sh
-#!/bin/bash
-TMPDIR=$1
-CPPFILE=$2
-FLANG=$3
-BINDIR=`dirname $FLANG`
-CPPCOMP=$BINDIR/clang++
-if [ -x $CCOMP ]
-then
-  $CPPCOMP $CPPFILE -o $TMPDIR/a.out
-  $TMPDIR/a.out # should print "PASS"
-else
-  # No clang compiler, just pass by default
-  echo "PASS"
-fi
+!-- -runtest.sh
+#!/ bin / bash
+         TMPDIR = $1 CPPFILE = $2 FLANG = $3 BINDIR =`dirname $FLANG` CPPCOMP =
+    $BINDIR / clang++ if[-x $CCOMP] then $CPPCOMP $CPPFILE -
+    o $TMPDIR / a.out $TMPDIR /
+        a.out #should print "PASS" else
+#No clang compiler, just pass by default
+        echo "PASS" fi

``````````

</details>


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


More information about the flang-commits mailing list