aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f9022
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90
new file mode 100644
index 000000000..9fa4bfc34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90
@@ -0,0 +1,22 @@
+! Bigendian test posted by Perseus in comp.lang.fortran on 4 July 2005.
+ integer(1), parameter :: zero = 0
+ LOGICAL, PARAMETER :: bigend = IACHAR(TRANSFER(1,"a")) == zero
+ LOGICAL :: bigendian
+ call foo ()
+contains
+ subroutine foo ()
+ integer :: chr, ans
+ if (bigend) then
+ ans = 1
+ else
+ ans = 0
+ end if
+ chr = IACHAR(TRANSFER(1,"a"))
+ bigendian = chr == 0_4
+ if (bigendian) then
+ ans = 1
+ else
+ ans = 0
+ end if
+ end subroutine foo
+end