aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Steinfeld <47540744+psteinfeld@users.noreply.github.com>2023-11-29 04:12:44 -0800
committerGitHub <noreply@github.com>2023-11-29 12:12:44 +0000
commitaf65379e383bac651f0868237e9086630b15ee0d (patch)
treed3338acfa8ea4bbe72f5a4ba280fc7f329078e3f
parent241076fb529eafccea9bae8bb407a57d83480745 (diff)
downloadllvm-af65379e383bac651f0868237e9086630b15ee0d.zip
llvm-af65379e383bac651f0868237e9086630b15ee0d.tar.gz
llvm-af65379e383bac651f0868237e9086630b15ee0d.tar.bz2
[flang] Fix test ctofortran (#73738)
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.
-rw-r--r--flang/test/Driver/ctofortran.f9013
1 files changed, 11 insertions, 2 deletions
diff --git a/flang/test/Driver/ctofortran.f90 b/flang/test/Driver/ctofortran.f90
index 828e87e..ceb253d 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 @@ void foo(CFI_cdesc_t*);
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 @@ int main() {
}
foo(desc);
- return 0;
+ return;
}
!--- runtest.sh
#!/bin/bash