Skip to content

Commit

Permalink
tests: Init for floor body [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Aug 12, 2021
1 parent 2f8e219 commit 120f148
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ RUN(NAME format_02 LABELS gfortran)

RUN(NAME submodule_01 LABELS gfortran)

RUN(NAME floor_01 LABELS gfortran) # floor body
RUN(NAME floor_02 LABELS gfortran) # floor symboltable
RUN(NAME intrinsics_01 LABELS gfortran) # sqrt, abs, log
RUN(NAME intrinsics_02 LABELS gfortran llvm) # sin
RUN(NAME intrinsics_03 LABELS gfortran llvm) # cos
Expand Down
10 changes: 10 additions & 0 deletions integration_tests/floor_01.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
program floor_01
real, parameter :: x1 = 3.3 ! 3
real, parameter :: x2 = 3.5 ! 3
real, parameter :: x3 = 3.7 ! 3
real, parameter :: y1 = -3.3 ! -4
real, parameter :: y2 = -3.5 ! -4
real, parameter :: y3 = -3.7 ! -4
print*, floor(x1), floor(x2), floor(x3)
print*, floor(y1), floor(y2), floor(y3)
end program
5 changes: 5 additions & 0 deletions src/runtime/lfortran_intrinsic_array.f90
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ real function real(x, kind)
integer, intent(in) :: x(:)
integer, intent(in) :: kind
end function

real function floor(x, kind)
integer, intent(in) :: x(:)
integer, intent(in) :: kind
end function
end interface

end module
10 changes: 10 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,16 @@ asr = true
filename = "../integration_tests/intrinsics_14.f90"
asr = true

# floor (body)
[[test]]
filename = "../integration_tests/floor_01.f90"
asr = true

# floor (symboltable)
[[test]]
filename = "../integration_tests/floor_02.f90"
asr = true

[[test]]
filename = "../integration_tests/intrinsics_open_close_read_write.f90"
asr = true
Expand Down

0 comments on commit 120f148

Please sign in to comment.