diff options
Diffstat (limited to 'gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_anyall.f90')
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_anyall.f90 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_anyall.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_anyall.f90 new file mode 100644 index 000000000..4e392c569 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_anyall.f90 @@ -0,0 +1,41 @@ +! Program to test the ANY and ALL intrinsics +program anyall + implicit none + logical, dimension(3, 3) :: a + logical, dimension(3) :: b + character(len=10) line + + a = .false. + if (any(a)) call abort + a(1, 1) = .true. + a(2, 3) = .true. + if (.not. any(a)) call abort + b = any(a, 1) + if (.not. b(1)) call abort + if (b(2)) call abort + if (.not. b(3)) call abort + b = .false. + write (line, 9000) any(a,1) + read (line, 9000) b + if (.not. b(1)) call abort + if (b(2)) call abort + if (.not. b(3)) call abort + + a = .true. + if (.not. all(a)) call abort + a(1, 1) = .false. + a(2, 3) = .false. + if (all(a)) call abort + b = all(a, 1) + if (b(1)) call abort + if (.not. b(2)) call abort + if (b(3)) call abort + b = .false. + write (line, 9000) all(a,1) + read (line, 9000) b + if (b(1)) call abort + if (.not. b(2)) call abort + if (b(3)) call abort + +9000 format (9L1) +end program |