* [Patch, Fortran] Fix for test case dec_union_4.f90
@ 2016-05-09 14:54 Fritz Reese
0 siblings, 0 replies; only message in thread
From: Fritz Reese @ 2016-05-09 14:54 UTC (permalink / raw)
To: gcc-patches, fortran
[-- Attachment #1: Type: text/plain, Size: 306 bytes --]
I was silly to assume little-endian integer representations for this
test case - of course it fails on big-endian machines. Fixed to use
endian-agnostic character strings.
ref
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56226
https://gcc.gnu.org/ml/gcc-testresults/2016-05/msg00779.html
---
Fritz Reese
[-- Attachment #2: dec_union_4.patch --]
[-- Type: application/octet-stream, Size: 2407 bytes --]
diff --git a/gcc/testsuite/gfortran.dg/dec_union_4.f90 b/gcc/testsuite/gfortran.dg/dec_union_4.f90
index 3bf6d61..4c1c6ef 100644
--- a/gcc/testsuite/gfortran.dg/dec_union_4.f90
+++ b/gcc/testsuite/gfortran.dg/dec_union_4.f90
@@ -14,29 +14,29 @@ end subroutine
structure /s4/
union ! U0 ! rax
map
- integer(8) rx
+ character(16) rx
end map
map
- integer(4) rh ! rah
+ character(8) rh ! rah
union ! U1
map
- integer(4) rl ! ral
+ character(8) rl ! ral
end map
map
- integer(4) ex ! eax
+ character(8) ex ! eax
end map
map
- integer(2) eh ! eah
+ character(4) eh ! eah
union ! U2
map
- integer(2) el ! eal
+ character(4) el ! eal
end map
map
- integer(2) x ! ax
+ character(4) x ! ax
end map
map
- integer(1) h ! ah
- integer(1) l ! al
+ character(2) h ! ah
+ character(2) l ! al
end map
end union
end map
@@ -48,15 +48,16 @@ record /s4/ r4
! Nested unions
-r4.rx = z'7A7B7CCC7FFFFFFF'
-if ( r4.rx .ne. z'7A7B7CCC7FFFFFFF' ) call aborts ("rax")
-if ( r4.rh .ne. z'7FFFFFFF' ) call aborts ("rah")
-if ( r4.rl .ne. z'7A7B7CCC' ) call aborts ("ral")
-if ( r4.ex .ne. z'7A7B7CCC' ) call aborts ("eax")
-if ( r4.eh .ne. z'7CCC' ) call aborts ("eah")
-if ( r4.el .ne. z'7A7B' ) call aborts ("eal")
-if ( r4.x .ne. z'7A7B' ) call aborts ("ax")
-if ( r4.h .ne. z'7B' ) call aborts ("ah")
-if ( r4.l .ne. z'7A' ) call aborts ("al")
+r4.rx = 'AAAAAAAA.BBB.C.D'
+
+if ( r4.rx .ne. 'AAAAAAAA.BBB.C.D' ) call aborts ("rax")
+if ( r4.rh .ne. 'AAAAAAAA' ) call aborts ("rah")
+if ( r4.rl .ne. '.BBB.C.D' ) call aborts ("ral")
+if ( r4.ex .ne. '.BBB.C.D' ) call aborts ("eax")
+if ( r4.eh .ne. '.BBB' ) call aborts ("eah")
+if ( r4.el .ne. '.C.D' ) call aborts ("eal")
+if ( r4.x .ne. '.C.D' ) call aborts ("ax")
+if ( r4.h .ne. '.C' ) call aborts ("ah")
+if ( r4.l .ne. '.D' ) call aborts ("al")
end
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-09 14:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 14:54 [Patch, Fortran] Fix for test case dec_union_4.f90 Fritz Reese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).