gcc/testsuite/gfortran.dg/scan_1.f90
raw| 1 | ! { dg-do run } |
| 2 | program b |
| 3 | integer w |
| 4 | character(len=2) s, t |
| 5 | s = 'xi' |
| 6 | |
| 7 | w = scan(s, 'iI') |
| 8 | if (w /= 2) STOP 1 |
| 9 | w = scan(s, 'xX', .true.) |
| 10 | if (w /= 1) STOP 2 |
| 11 | w = scan(s, 'ab') |
| 12 | if (w /= 0) STOP 3 |
| 13 | w = scan(s, 'ab', .true.) |
| 14 | if (w /= 0) STOP 4 |
| 15 | |
| 16 | s = 'xi' |
| 17 | t = 'iI' |
| 18 | w = scan(s, t) |
| 19 | if (w /= 2) STOP 5 |
| 20 | t = 'xX' |
| 21 | w = scan(s, t, .true.) |
| 22 | if (w /= 1) STOP 6 |
| 23 | t = 'ab' |
| 24 | w = scan(s, t) |
| 25 | if (w /= 0) STOP 7 |
| 26 | w = scan(s, t, .true.) |
| 27 | if (w /= 0) STOP 8 |
| 28 | |
| 29 | end program b |
| 30 | |
| 31 | |
| 32 |