Skip to content

Commit af65379

Browse files
authored
[flang] Fix test ctofortran (llvm#73738)
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.
1 parent 241076f commit af65379

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

flang/test/Driver/ctofortran.f90

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
! RUN: %t/runtest.sh %t %flang $t/ffile.f90 $t/cfile.c
66

77
!--- ffile.f90
8+
program fmain
9+
interface
10+
subroutine csub() bind(c)
11+
end subroutine
12+
end interface
13+
14+
call csub()
15+
end program fmain
16+
817
subroutine foo(a) bind(c)
918
integer :: a(:)
1019
if (lbound(a, 1) .ne. 1) then
@@ -37,7 +46,7 @@ end subroutine foo
3746

3847
int a[10];
3948

40-
int main() {
49+
void csub() {
4150
int i, res;
4251
static CFI_CDESC_T(1) r1;
4352
CFI_cdesc_t *desc = (CFI_cdesc_t*)&r1;
@@ -55,7 +64,7 @@ end subroutine foo
5564
}
5665

5766
foo(desc);
58-
return 0;
67+
return;
5968
}
6069
!--- runtest.sh
6170
#!/bin/bash

0 commit comments

Comments
 (0)