Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / string_null_compare_1.f
blob2e6eb1b2b88feb3ceba042b95f376fda3d7b30e1
1 ! { dg-do run }
2 ! PR 27784 - Different strings should compare unequal even if they
3 ! have CHAR(0) in them.
5 program main
6 character*3 str1, str2
7 call setval(str1, str2)
8 if (str1 == str2) call abort
9 end
11 subroutine setval(str1, str2)
12 character*3 str1, str2
13 str1 = 'a' // CHAR(0) // 'a'
14 str2 = 'a' // CHAR(0) // 'c'
15 end