main
test-branch
| Line | |
|---|
| 1 | ! @expect verified
|
|---|
| 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.