source: CIVL/examples/fortran/smack/fib_fail.f90

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 481 bytes
Line 
1! @expect verified
2! @flag --unroll=10
3
4recursive function fib(n)
5 implicit none
6 integer, intent(in) :: n
7 integer :: fib
8 if (n <= 0) then
9 fib = 0
10 else if (n == 1) then
11 fib = 1
12 else
13 fib = fib(n - 1) + fib(n - 2)
14 end if
15end function
16
17program main
18 implicit none
19 integer :: fib
20 !print *, fib(5) == 5
21 !print *, fib(6) == 8
22 integer :: z
23 !z = fib(2)
24 !!CVL $assert(z > 18)
25 !$CVL $assert(fib(5) /= 5)
26 !$CVL $assert(fib(6) == 8)
27end program main
Note: See TracBrowser for help on using the repository browser.