| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! PR12456 - Optimize string(k:k) as single character. |
| 4 |
|
| 5 |
Program pr12456 |
| 6 |
character a |
| 7 |
character b |
| 8 |
character (len=5) :: c |
| 9 |
integer i |
| 10 |
|
| 11 |
b = 'a' |
| 12 |
a = b |
| 13 |
if (a .ne. 'a') STOP 1 |
| 14 |
if (a .ne. b) STOP 2 |
| 15 |
c (3:3) = 'a' |
| 16 |
if (c (3:3) .ne. b) STOP 3 |
| 17 |
if (c (3:3) .ne. 'a') STOP 4 |
| 18 |
if (LGT (a, c (3:3))) STOP 5 |
| 19 |
if (LGT (a, 'a')) STOP 6 |
| 20 |
|
| 21 |
i = 3 |
| 22 |
c (i:i) = 'a' |
| 23 |
if (c (i:i) .ne. b) STOP 7 |
| 24 |
if (c (i:i) .ne. 'a') STOP 8 |
| 25 |
if (LGT (a, c (i:i))) STOP 9 |
| 26 |
|
| 27 |
if (a .gt. char (255)) STOP 10 |
| 28 |
end |
| 29 |
|
| 30 |
! There should not be _gfortran_compare_string and _gfortran_copy_string in |
| 31 |
! the dumped file. |
| 32 |
|
| 33 |
! { dg-final { scan-tree-dump-times "_gfortran_compare_string" 0 "original" } } |
| 34 |
! { dg-final { scan-tree-dump-times "_gfortran_copy_string" 0 "original" } } |
| 35 |
|