Issue 153426
Summary [flang] `INQUIRE` statement returns incorrect `POSITION=`
Labels flang:runtime
Assignees
Reporter DanielCChen
    Consider the following reducer:
```
    character(10) decMode, pos

    open (1, status='scratch', position='rewind')

    inquire (1, decimal=decMode, position=pos)

    if ((decMode /= 'POINT') .or. (pos /= 'REWIND')) ERROR STOP 1

    write (1, *, decimal='COmma') 'abc', cmplx(2.2, 1.1), 10, 3.1

    rewind (1)

    open (1, position='rewind', status='old', decimal='coMMA')

    inquire (1, decimal=decMode, position=pos)

print*, decMode
print*, pos
    if ((decMode /= 'COMMA') .or. (pos /= 'REWIND')) ERROR STOP 2

    close(1)

    end
```

Flang failed as:
```
> a.out
 COMMA
 APPEND
Fortran ERROR STOP: code 2
```

The expected output is
```
> a.out
 COMMA
 REWIND
```


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to