Commit 7095a86f authored by Slava Zakharin's avatar Slava Zakharin
Browse files

[flang][hlfir] Fixed where/elsewhere mask saving in case of conflicts.

The assignments inside where/elsewhere may affect variables participating
in the mask expression, but execution of the assignments must not affect
the established control mask(s) (F'18 10.2.3.2 p. 13).

The following example must print all 42's:
```
program test
  integer c(3)
  logical :: mask(3) = .true.
  where (mask)
     c = f()
  end where
  print *, c
contains
  integer function f()
    mask = .false.
    f = 42
  end function f
end program test
```

Reviewed By: tblah

Differential Revision: https://reviews.llvm.org/D156959
parent 44000181
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment