Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Overbey2009-02-24 22:15:37 +0000
committerJeffrey Overbey2009-02-24 22:15:37 +0000
commit9b9901b5f174251adf614c4fb1f8e1c234e60733 (patch)
tree3cbfd40a826758512ae5789bc8d84530c99ff18f
parent08ebd616856a2aa0bfaffcb8edba2aa12a42ae9b (diff)
downloadorg.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.f0341
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

Back to the top