PR middle-end/77674
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_null_compare_1.f
blob659b3eb3709f597209f022413a7d1bf3bbfc9737
1 ! { dg-do run }
2 ! { dg-options "-std=legacy" }
4 ! PR 27784 - Different strings should compare unequal even if they
5 ! have CHAR(0) in them.
7 program main
8 character*3 str1, str2
9 call setval(str1, str2)
10 if (str1 == str2) call abort
11 end
13 subroutine setval(str1, str2)
14 character*3 str1, str2
15 str1 = 'a' // CHAR(0) // 'a'
16 str2 = 'a' // CHAR(0) // 'c'
17 end