diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/parameter_array_init_4.f90 | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.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/parameter_array_init_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/parameter_array_init_4.f90 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/parameter_array_init_4.f90 b/gcc/testsuite/gfortran.dg/parameter_array_init_4.f90 new file mode 100644 index 000000000..f6c2f84b2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/parameter_array_init_4.f90 @@ -0,0 +1,55 @@ +! { dg-do run } +! PR fortran/36476 +! +IMPLICIT NONE +CHARACTER (len=*) MY_STRING(1:3), my_string_s +PARAMETER ( MY_STRING = (/ "A" , "B", "C" /) ) +PARAMETER ( MY_STRING_S = "AB C" ) +character(len=*), parameter :: str(2) = [ 'Ac','cc'] +character(len=*), parameter :: str_s = 'Acc' + +CHARACTER (kind=1,len=*) MY_STRING1(1:3), my_string_s1 +PARAMETER ( MY_STRING1 = (/ "A" , "B", "C" /) ) +PARAMETER ( MY_STRING_S1 = "AB C" ) +character(kind=1,len=*), parameter :: str1(2) = [ 1_'Ac',1_'cc'] +character(kind=1,len=*), parameter :: str_s1 = 'Acc' + +CHARACTER (kind=4,len=*) MY_STRING4(1:3), my_string_s4 +PARAMETER ( MY_STRING4 = (/ 4_"A" , 4_"B", 4_"C" /) ) +PARAMETER ( MY_STRING_S4 = 4_"AB C" ) +character(kind=4,len=*), parameter :: str4(2) = [ 4_'Ac',4_'cc'] +character(kind=4,len=*), parameter :: str_s4 = 4_'Acc' + +if(len(MY_STRING) /= 1) call abort() +if( MY_STRING(1) /= "A" & + .or.MY_STRING(2) /= "B" & + .or.MY_STRING(3) /= "C") call abort() +if(len(MY_STRING_s) /= 4) call abort() +if(MY_STRING_S /= "AB C") call abort() +if(len(str) /= 2) call abort() +if(str(1) /= "Ac" .or. str(2) /= "cc") call abort() +if(len(str_s) /= 3) call abort() +if(str_s /= 'Acc') call abort() + +if(len(MY_STRING1) /= 1) call abort() +if( MY_STRING1(1) /= 1_"A" & + .or.MY_STRING1(2) /= 1_"B" & + .or.MY_STRING1(3) /= 1_"C") call abort() +if(len(MY_STRING_s1) /= 4) call abort() +if(MY_STRING_S1 /= 1_"AB C") call abort() +if(len(str1) /= 2) call abort() +if(str1(1) /= 1_"Ac" .or. str1(2) /= 1_"cc") call abort() +if(len(str_s1) /= 3) call abort() +if(str_s1 /= 1_'Acc') call abort() + +if(len(MY_STRING4) /= 1) call abort() +if( MY_STRING4(1) /= 4_"A" & + .or.MY_STRING4(2) /= 4_"B" & + .or.MY_STRING4(3) /= 4_"C") call abort() +if(len(MY_STRING_s4) /= 4) call abort() +if(MY_STRING_S4 /= 4_"AB C") call abort() +if(len(str4) /= 2) call abort() +if(str4(1) /= 4_"Ac" .or. str4(2) /= 4_"cc") call abort() +if(len(str_s4) /= 3) call abort() +if(str_s4 /= 4_'Acc') call abort() +end |