Skip to content

[flang] Fix test ctofortran #73738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Conversation

psteinfeld
Copy link
Contributor

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.

After merge request llvm#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.
@llvmbot llvmbot added flang:driver flang Flang issues not falling into any other category labels Nov 29, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 29, 2023

@llvm/pr-subscribers-flang-driver

Author: Pete Steinfeld (psteinfeld)

Changes

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 --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

Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the quick fix Pete! 🙏🏻

@mjklemm
Copy link
Contributor

mjklemm commented Nov 29, 2023

Thanks for fixing this! And apologies for having missed this!

Copy link
Contributor

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DavidSpickett
Copy link
Collaborator

Going to merge this to fix Linaro's bots. Thanks for fixing this!

@DavidSpickett DavidSpickett merged commit af65379 into llvm:main Nov 29, 2023
@psteinfeld psteinfeld deleted the ps-fix-ctofortran branch October 7, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants