[flang] Fix bug in .mod file for some subprogram attributes
authorTim Keith <tkeith@nvidia.com>
Tue, 20 Aug 2019 21:49:37 +0000 (14:49 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 23 Aug 2019 14:14:55 +0000 (07:14 -0700)
commit191a5e34b0678bdb587d39658beb9432ef97c969
treeb2738b0c3e03625ca75e2f3fe090c8e6ca30a319
parentabd56ee7fd06a4075c0dd66bb99c5ce441752c11
[flang] Fix bug in .mod file for some subprogram attributes

Some attributes for subprograms can be in the subprogram prefix but
others cannot. For the latter, emit a separate attribute statement
to specify them. We were already doing that for PRIVATE but not for
OPTIONAL. Those may be the only two attributes this can apply to.

Fixes flang-compiler/f18#659.

Original-commit: flang-compiler/f18@ae67e087800c5aecb8cb2d2aea16d19b8cc8ccf2
Reviewed-on: https://github.com/flang-compiler/f18/pull/675
Tree-same-pre-rewrite: false
flang/lib/semantics/mod-file.cc
flang/test/semantics/modfile01.f90