Skip to content

Commit 4e94935

Browse files
author
rasmussn
committed
Initial version.
1 parent dd13a53 commit 4e94935

13 files changed

Lines changed: 177 additions & 0 deletions

tests/bug-reports-sf/rose/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
SYNTAX = ../../src/syntax
2+
3+
all : check
4+
5+
$(SYNTAX)/Fortran.tbl :
6+
cd $(SYNTAX) ; make ; cd -
7+
8+
check : $(SYNTAX)/Fortran.tbl
9+
@for file in *.f90 ; do \
10+
echo "Running test $$file"; \
11+
sglri -p $(SYNTAX)/Fortran.tbl -i $$file -o $$file.ast; \
12+
if test $$? != 0 ; then \
13+
echo $$file " FAILED!"; \
14+
fi; \
15+
pp-aterm -i $$file.ast -o $$file.ast.aterm; \
16+
done;
17+
18+
junk :
19+
sglri -p $(SYNTAX)/Fortran.tbl -i junk.f90 -o junk.f90.ast
20+
pp-aterm -i junk.f90.ast -o junk.f90.aterm
21+
22+
clean :
23+
rm -f *.ast *.ast.aterm
24+
rm -f *.o *.mod
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
integer, parameter :: MAX_DEBUG = 50
2+
INTEGER, SAVE :: define_kind_debug = 0
3+
integer, save :: define_kind_i (MAX_DEBUG) = 0
4+
real, save :: define_kind_r8(MAX_DEBUG) = 0.0
5+
6+
end
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module newmodule
2+
3+
public newtype
4+
5+
type newtype
6+
integer :: i
7+
end type
8+
9+
end module
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module test_struct
2+
3+
type var_wrap
4+
real, dimension(:,:), pointer :: ptr2d
5+
integer :: sizes(3)
6+
end type
7+
8+
contains
9+
10+
subroutine foo()
11+
type(var_wrap) :: vw
12+
13+
vw%ptr2d(1,vw%sizes(2)) = 1
14+
15+
end subroutine
16+
17+
end module
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
integer, parameter :: MAX_FILE_TYPE_LEN_IS_VERY_LONG = 10
2+
integer, parameter :: NUMBER_FILE_TYPES = 9
3+
4+
character(MAX_FILE_TYPE_LEN_IS_VERY_LONG), parameter :: chararray(NUMBER_FILE_TYPES) = (/ &
5+
'undefined1', &
6+
'undefined2', &
7+
'undefined3', &
8+
'undefined4', &
9+
'undefined5', &
10+
'undefined6', &
11+
'undefined7', &
12+
'undefined8', &
13+
'undefined9' /)
14+
15+
end
16+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module go_dog_go
2+
implicit none
3+
4+
interface bob
5+
module procedure bob
6+
7+
end interface
8+
9+
contains
10+
integer function bob()
11+
bob = 1
12+
end function bob
13+
end module go_dog_go
14+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!
2+
! bug 3311490
3+
!
4+
! In ROSE foo is unparsed with the pointer attribute.
5+
!
6+
procedure() :: foo
7+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
!
2+
! Unit test for bug 3385969. Boz literals are handled by OFP correctly
3+
! but not by ROSE.
4+
!
5+
integer, parameter :: INT8 = SELECTED_INT_KIND(16)
6+
integer(INT8), parameter :: ieee64_two = Z'4000000000000000'
7+
integer, parameter :: binary = B'1101'
8+
integer, parameter :: octal = O'15'
9+
integer, parameter :: hex = Z'D'
10+
11+
print *, ieee64_two
12+
print *, binary
13+
print *, octal
14+
print *, hex
15+
16+
if (binary .ne. 13 .and. octal .ne. 13 .and. hex .ne. 13) stop 1
17+
18+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!
2+
! Regression test for ROSE bug 3386150
3+
!
4+
! Title: ROSE: Array initialization to scalar unparses incorrectly
5+
!
6+
! The bug occurs when the array inializer is unparsed as (/0/),
7+
! rather than as the scalar, 0.
8+
!
9+
integer :: A(3) = 0
10+
11+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!
2+
! Regression test for ROSE bug 3387076
3+
!
4+
! Title: ROSE: Array initialization unparses incorrectly
5+
!
6+
! The bug occurs when the array inializer is unparsed as (/(/1,2,3/)/),
7+
! rather than (/1,2,3/)
8+
!
9+
integer :: A(3) = [1,2,3]
10+
11+
end

0 commit comments

Comments
 (0)