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