Skip to content

Commit

Permalink
Add a test for the new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Jul 8, 2021
1 parent 3d5303c commit c9212c9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ RUN(NAME if_04 LABELS gfortran x86)
RUN(NAME case_01 LABELS gfortran llvm)
RUN(NAME case_02 LABELS gfortran llvm)
RUN(NAME case_03 LABELS gfortran llvm)
RUN(NAME case_04 LABELS gfortran)

RUN(NAME select_type_01 LABELS gfortran)

Expand Down
13 changes: 13 additions & 0 deletions integration_tests/case_04.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
program case_04
implicit none
integer :: i
i = 4

select case(i)
case (1)
print *, "1"
case (2,3:5,6,8:10)
print *, "2,3:5,6,8:10"
end select

end
13 changes: 13 additions & 0 deletions tests/reference/ast_f90-case_04-851a3b2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "ast_f90-case_04-851a3b2",
"cmd": "lfortran --show-ast-f90 --no-color {infile}",
"infile": "tests/../integration_tests/case_04.f90",
"infile_hash": "55392e5b3b536591894e60672e49e61f8c579e20edb5d007f1f1afae",
"outfile": null,
"outfile_hash": null,
"stdout": "ast_f90-case_04-851a3b2.stdout",
"stdout_hash": "e4899c1c904cae8af40488cfba12148bfbff9b46cfc557b7df3f2594",
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
11 changes: 11 additions & 0 deletions tests/reference/ast_f90-case_04-851a3b2.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
program case_04
implicit none
integer :: i
i = 4
select case (i)
case (1)
print *, "1"
case (2, 3:5, 6, 8:10)
print *, "2,3:5,6,8:10"
end select
end program case_04
5 changes: 5 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,11 @@ ast_f90 = true
asr = true
llvm = true

[[test]]
filename = "../integration_tests/case_04.f90"
ast = true
ast_f90 = true

[[test]]
filename = "../integration_tests/program_02.f90"
ast = true
Expand Down

0 comments on commit c9212c9

Please sign in to comment.