PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_compare_1.f90
blob30cf357174f467e627721bf2774f97fa12b7774c
1 ! { dg-do run }
3 ! PR fortran/37099
4 ! Check for correct results when comparing array-section-substrings.
6 PROGRAM main
7 IMPLICIT NONE
9 CHARACTER(*), PARAMETER :: exprs(1) = (/ 'aa' /)
11 CHARACTER(*), PARAMETER :: al1 = 'a';
12 CHARACTER(len=LEN (al1)) :: al2 = al1;
14 LOGICAL :: tmp(1), tmp2(1)
16 tmp = (exprs(1:1)(1:1) == al1)
17 tmp2 = (exprs(1:1)(1:1) == al2)
19 PRINT '(L1)', tmp
20 PRINT '(L1)', tmp2
22 IF (.NOT. tmp(1) .OR. .NOT. tmp2(1)) THEN
23 CALL abort ()
24 END IF
25 END PROGRAM main