-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Fortan): add first assumed-rank unit test
- Loading branch information
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
llvm_singlesource() | ||
|
||
file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
program rank_dummy_select_intrinsic | ||
implicit none | ||
integer a, a1(1), a2(1,1), a3(1,1,1), a4(1,1,1, 1), a5(1,1,1, 1,1), a6(1,1,1, 1,1,1), a7(1,1,1, 1,1,1, 1) | ||
integer a8(1,1,1, 1,1,1, 1,1), a9(1,1,1, 1,1,1, 1,1,1), a10(1,1,1, 1,1,1, 1,1,1, 1), a11(1,1,1, 1,1,1, 1,1,1, 1,1) | ||
integer a12(1,1,1, 1,1,1, 1,1,1, 1,1,1), a13(1,1,1, 1,1,1, 1,1,1, 1,1,1, 1), a14(1,1,1, 1,1,1, 1,1,1, 1,1,1, 1,1) | ||
integer a15(1,1,1, 1,1,1, 1,1,1, 1,1,1, 1,1,1) | ||
|
||
call print_rank(a) | ||
call print_rank(a1) | ||
call print_rank(a2) | ||
call print_rank(a3) | ||
call print_rank(a4) | ||
call print_rank(a5) | ||
call print_rank(a6) | ||
call print_rank(a7) | ||
call print_rank(a8) | ||
call print_rank(a9) | ||
call print_rank(a10) | ||
call print_rank(a11) | ||
call print_rank(a12) | ||
call print_rank(a13) | ||
call print_rank(a14) | ||
call print_rank(a15) | ||
|
||
contains | ||
|
||
subroutine print_rank(a) | ||
integer a(..) | ||
character(len=*), parameter :: format_='(a,i2)' | ||
|
||
select rank(a) | ||
rank(0) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(1) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(2) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(3) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(4) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(5) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(6) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(7) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(8) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(9) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(10) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(11) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(12) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(13) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(14) | ||
print format_,"rank(a) = ",rank(a) | ||
rank(15) | ||
print format_,"rank(a) = ",rank(a) | ||
rank default | ||
error stop "unrecognized rank" | ||
end select | ||
end subroutine | ||
|
||
end program rank_dummy_select_intrinsic |
17 changes: 17 additions & 0 deletions
17
Fortran/UnitTests/assumed-rank/dummy-select-intrinsic.reference_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
rank(a) = 0 | ||
rank(a) = 1 | ||
rank(a) = 2 | ||
rank(a) = 3 | ||
rank(a) = 4 | ||
rank(a) = 5 | ||
rank(a) = 6 | ||
rank(a) = 7 | ||
rank(a) = 8 | ||
rank(a) = 9 | ||
rank(a) = 10 | ||
rank(a) = 11 | ||
rank(a) = 12 | ||
rank(a) = 13 | ||
rank(a) = 14 | ||
rank(a) = 15 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config.traditional_output = True | ||
config.single_source = True |