[flang-commits] [flang] [Flang] Add parsing and attribute registration for SIMPLE specifier (PR #161285)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Fri Mar 13 15:45:57 PDT 2026
eugeneepshteyn wrote:
@mlir-maiden , please check the following:
(1) It seems that in `CharacterizeProcedure()` you may need to tell procedure being characterized that it's SIMPLE procedure. Consider the following:
```
subroutine test(f)
interface
simple subroutine f()
end subroutine
interface
end subroutine
```
What are the characteristics of `f()`? Do they include `SIMPLE`?
(2) Please check if the following compiles:
```
module test_simple
abstract interface
simple subroutine simple_proc()
end subroutine
end interface
contains
subroutine call_it(p)
procedure(simple_proc) :: p
end subroutine
simple subroutine my_simple()
end subroutine
subroutine test()
call call_it(my_simple)
end subroutine
end module
```
(3) The following should work, because ABS (and many other intrinsics) are inherently SIMPLE:
```
simple subroutine test()
real :: x
x = abs(-1.0)
end subroutine
```
(4) This should fail:
```
simple impure subroutine bug()
end subroutine
```
https://github.com/llvm/llvm-project/pull/161285
More information about the flang-commits
mailing list