aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-11-09 16:56:53 +0100
committerJanus Weil <janus@gcc.gnu.org>2011-11-09 16:56:53 +0100
commit560bb0136fa74c8562d7e078eef29d3d1f7b6fc5 (patch)
tree868bae4451cbc2f6237a3d19cb699cca18888c54 /gcc
parented10039e8bd1f3a2887429aaa7943a4f7257ee54 (diff)
downloadgcc-560bb0136fa74c8562d7e078eef29d3d1f7b6fc5.zip
gcc-560bb0136fa74c8562d7e078eef29d3d1f7b6fc5.tar.gz
gcc-560bb0136fa74c8562d7e078eef29d3d1f7b6fc5.tar.bz2
re PR fortran/50960 ([OOP] vtables not marked as constant)
2011-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/50960 * gfortran.dg/typebound_call_22.f03: New test case. From-SVN: r181208
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_22.f0332
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a0eeb32..83ef171 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50960
+ * gfortran.dg/typebound_call_22.f03: New test case.
+
2011-11-09 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/50016
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_22.f03 b/gcc/testsuite/gfortran.dg/typebound_call_22.f03
new file mode 100644
index 0000000..b5aa8ee
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_22.f03
@@ -0,0 +1,32 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-optimized -O" }
+!
+! PR 50960: [OOP] vtables not marked as constant
+!
+! This test case checks whether the type-bound call to "x%bar"
+! is optimized into a static call to "base".
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module m
+ type t
+ contains
+ procedure, nopass :: bar => base
+ end type
+contains
+ subroutine base()
+ write(*,*) 'base'
+ end subroutine
+end module
+
+program test
+ use m
+ class(t), allocatable :: x
+ allocate (t :: x)
+ call x%bar ()
+end program
+
+! { dg-final { scan-tree-dump-times "base \\(\\);" 1 "optimized" } }
+! { dg-final { cleanup-tree-dump "optimized" } }
+
+! { dg-final { cleanup-modules "m" } }