summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/widechar_IO_2.f90
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-23 06:06:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-23 06:06:29 +0000
commit8a096472683581315df6e6747212356b3255087e (patch)
treedac105eba22e3c3a544b760bd2ca5b1db944f65e /gcc/testsuite/gfortran.dg/widechar_IO_2.f90
parent63217c8a41fa03e943e9859df194ab78cbe8639b (diff)
downloadgcc-8a096472683581315df6e6747212356b3255087e.tar.gz
2008-06-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137030 * gcc/melt/warm-basilys.bysl: some primitives got explicit casts. * gcc/basilys.h: added casts to avoid implicit conversion from void* disallowed with C++ * gcc/basilys.c: (delete_special, forwarded, scanning) likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137031 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/widechar_IO_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/widechar_IO_2.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/widechar_IO_2.f90 b/gcc/testsuite/gfortran.dg/widechar_IO_2.f90
new file mode 100644
index 00000000000..6b13e4f93f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/widechar_IO_2.f90
@@ -0,0 +1,19 @@
+! { dg-do run }
+! Wide chracter I/O test 2, formatted array write and read
+! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program chkdata
+ integer, parameter :: k4=4
+ character(len=7, kind=k4), dimension(3) :: mychar
+ character(50) :: buffer
+ mychar(1) = k4_"abc1234"
+ mychar(2) = k4_"def5678"
+ mychar(3) = k4_"ghi9012"
+ buffer = ""
+ write(buffer,'(3(a))') mychar(2:3), mychar(1)
+ if (buffer /= "def5678ghi9012abc1234") call abort
+ write(buffer,'(3(a))') mychar
+ if (buffer /= "abc1234def5678ghi9012") call abort
+ mychar = ""
+ read(buffer,'(3(a))') mychar
+ if (any(mychar.ne.[ k4_"abc1234",k4_"def5678",k4_"ghi9012" ])) call abort
+end program chkdata