Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/whole_file_10.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do compile } | |
2 ! { dg-options "-fwhole-file" } | |
3 ! Test the fix for the fifth problem in PR40011, where the | |
4 ! entries were not resolved, resulting in a segfault. | |
5 ! | |
6 ! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> | |
7 ! | |
8 recursive function fac(i) result (res) | |
9 integer :: i, j, k, res | |
10 k = 1 | |
11 goto 100 | |
12 entry bifac(i,j) result (res) | |
13 k = j | |
14 100 continue | |
15 if (i < k) then | |
16 res = 1 | |
17 else | |
18 res = i * bifac(i-k,k) | |
19 end if | |
20 end function | |
21 | |
22 program test | |
23 external fac | |
24 external bifac | |
25 integer :: fac, bifac | |
26 print *, fac(5) | |
27 print *, bifac(5,2) | |
28 print*, fac(6) | |
29 print *, bifac(6,2) | |
30 print*, fac(0) | |
31 print *, bifac(1,2) | |
32 end program test |