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:
391 bytes
|
| Rev | Line | |
|---|
| [e3f356c] | 1 | ! @expect error
|
|---|
| 2 |
|
|---|
| 3 | pure function cap(x)
|
|---|
| 4 | implicit none
|
|---|
| 5 | integer, intent(in) :: x
|
|---|
| 6 | integer :: y
|
|---|
| 7 | integer :: cap
|
|---|
| 8 | y = x
|
|---|
| 9 | if (10 < y) then
|
|---|
| 10 | y = 10
|
|---|
| 11 | end if
|
|---|
| 12 | cap = y
|
|---|
| 13 | end function
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | program main
|
|---|
| 17 | implicit none
|
|---|
| 18 | integer :: cap
|
|---|
| 19 | integer :: x
|
|---|
| 20 | !$CVL $input
|
|---|
| 21 | integer :: n
|
|---|
| 22 | !$CVL $assert(cap(2) == 2)
|
|---|
| 23 | !$CVL $assert(cap(15) /= 10)
|
|---|
| 24 | x = n
|
|---|
| 25 | !$CVL $assert(cap(x) <= 10)
|
|---|
| 26 | end program main
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.