summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/derived_constructor_char_1.f9050
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90 b/gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90
new file mode 100644
index 000000000..20f3cf93e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/derived_constructor_char_1.f90
@@ -0,0 +1,50 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/44857
+!
+!
+ Type :: t5
+ character (len=5) :: txt(4)
+ End Type t5
+
+ character (len=3), parameter :: str3(2) = [ "ABC", "ZYX" ]
+ character (len=5), parameter :: str5(2) = [ "AbCdE", "ZyXwV" ]
+ character (len=5), parameter :: str7(2) = [ "aBcDeFg", "zYxWvUt" ]
+
+ Type (t5) :: one = t5((/ "12345", "67890" /))
+ Type (t5) :: two = t5((/ "123", "678" /))
+ Type (t5) :: three = t5((/ "1234567", "abcdefg" /))
+ Type (t5) :: four = t5(str3)
+ Type (t5) :: five = t5(str5)
+ Type (t5) :: six = t5(str7)
+ print '(2a)', one, two, three, four, five, six
+End
+
+subroutine wasICEing()
+ implicit none
+
+ Type :: Err_Text_Type
+ integer :: nlines
+ character (len=132), dimension(5) :: txt
+ End Type Err_Text_Type
+
+ Type (Err_Text_Type) :: Mess_FindFMT = &
+ Err_Text_Type(0, (/" "," "," "," "," "/))
+end subroutine wasICEing
+
+subroutine anotherCheck()
+ Type :: t
+ character (len=3) :: txt(2)
+ End Type
+ Type (t) :: tt = t((/ character(len=5) :: "12345", "67890" /))
+ print *, tt
+end subroutine
+
+! { dg-final { scan-tree-dump-times "one = ..txt=..12345., .67890...;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "two = ..txt=..123 ., .678 ...;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "three = ..txt=..12345., .abcde...;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "four = ..txt=..ABC ., .ZYX ...;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "five = ..txt=..AbCdE., .ZyXwV...;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "six = ..txt=..aBcDe., .zYxWv...;" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }