diff options
author | Jeffrey Overbey | 2009-02-24 22:15:37 +0000 |
---|---|---|
committer | Jeffrey Overbey | 2009-02-24 22:15:37 +0000 |
commit | 9b9901b5f174251adf614c4fb1f8e1c234e60733 (patch) | |
tree | 3cbfd40a826758512ae5789bc8d84530c99ff18f | |
parent | 08ebd616856a2aa0bfaffcb8edba2aa12a42ae9b (diff) | |
download | org.eclipse.photran-9b9901b5f174251adf614c4fb1f8e1c234e60733.tar.gz org.eclipse.photran-9b9901b5f174251adf614c4fb1f8e1c234e60733.tar.xz org.eclipse.photran-9b9901b5f174251adf614c4fb1f8e1c234e60733.zip |
Added xlf-bug2 example
-rw-r--r-- | org.eclipse.photran-samples/src-fortran2003/xlf-bug2.f03 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.photran-samples/src-fortran2003/xlf-bug2.f03 b/org.eclipse.photran-samples/src-fortran2003/xlf-bug2.f03 new file mode 100644 index 00000000..78f4ffa7 --- /dev/null +++ b/org.eclipse.photran-samples/src-fortran2003/xlf-bug2.f03 @@ -0,0 +1,41 @@ +! xlf-bug2.f03 - Implementation of the xlf-bug2 class and xlf-bug2_module module +module module + implicit none + + ! Abstract class "super" contains two routines + ! * accept_any accepts a pointer to class(*) + ! * return_any returns a pointer to class(*) + type, abstract :: super + contains + procedure :: accept_any + procedure :: return_any + end type + abstract interface + subroutine accept_any(self, arg) + import super + class(super), intent(in) :: self + class(*), pointer, intent(in) :: arg + end subroutine + function return_any(self) result(return) + import super + class(super), intent(in) :: self + class(*), pointer :: return + end function + end interface + + type, extends(super) :: base + contains + procedure :: accept_any => base_accept_any + procedure :: return_any => base_return_any + end type +contains + subroutine base_accept_any(self, arg) + class(base), intent(in) :: self + class(*), pointer, intent(in) :: arg + end subroutine + function base_return_any(self) result(return) + class(base), intent(in) :: self + class(*), pointer :: return + return => null() + end function +end module |