[flang-commits] [flang] [flang] Fix test ctofortran (PR #73738)

via flang-commits flang-commits at lists.llvm.org
Tue Nov 28 19:13:05 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-driver

Author: Pete Steinfeld (psteinfeld)

<details>
<summary>Changes</summary>

After merge request #<!-- -->73124, the flang test Driver/ctofortran started failing because both the C and the Fortran code had main programs.  This update fixes that by eliminating the C main program in the test.

---
Full diff: https://github.com/llvm/llvm-project/pull/73738.diff


1 Files Affected:

- (modified) flang/test/Driver/ctofortran.f90 (+11-2) 


``````````diff
diff --git a/flang/test/Driver/ctofortran.f90 b/flang/test/Driver/ctofortran.f90
index 828e87e89db69b0..ceb253def5c52bc 100644
--- a/flang/test/Driver/ctofortran.f90
+++ b/flang/test/Driver/ctofortran.f90
@@ -5,6 +5,15 @@
 ! RUN: %t/runtest.sh %t %flang $t/ffile.f90 $t/cfile.c
 
 !--- ffile.f90
+program fmain
+  interface
+    subroutine csub() bind(c)
+    end subroutine
+  end interface
+
+  call csub()
+end program fmain
+
 subroutine foo(a) bind(c)
   integer :: a(:)
   if (lbound(a, 1) .ne. 1) then
@@ -37,7 +46,7 @@ end subroutine foo
 
 int a[10];
 
-int main() {
+void csub() {
   int i, res;
   static CFI_CDESC_T(1) r1;
   CFI_cdesc_t *desc = (CFI_cdesc_t*)&r1;
@@ -55,7 +64,7 @@ end subroutine foo
   }
 
   foo(desc);
-  return 0;
+  return;
 }
 !--- runtest.sh
 #!/bin/bash

``````````

</details>


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


More information about the flang-commits mailing list