[flang] Support intent-stmt and resolve subprogram prefixes and suffixes.
authorTim Keith <tkeith@nvidia.com>
Thu, 12 Jul 2018 00:45:13 +0000 (17:45 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 12 Jul 2018 00:45:13 +0000 (17:45 -0700)
commitd42bb955a6c4b72a6d1b395658f782731dc358cf
tree1252445da47d91c670843f4f2e7686126382db2e
parentd820ff8a7674df8715d49138613e8cac01e2f093
[flang] Support intent-stmt and resolve subprogram prefixes and suffixes.

Recognize `IntentStmt` and use `HandleAttributeStmt()` to implement it
as is done with other attribute statements. Add `Attr::INTENT_INOUT` as
a separate attribute for `INTENT(INOUT)`.

Collect attributes from the prefix and suffix of `FunctionStmt` and
`SubroutineStmt` (including `BIND(C)`) and set them on the subprogram
symbol.

Create a test for this using `test_symbol.sh`. It compiles with
`-funparse-with-symbols` and compares the output with the symbols in
comments in the input.

Change `test_errors.sh` to be similar to `test_symbol.sh`: check usage
and allow `F18` environment variable to override the path to the
compiler.

Original-commit: flang-compiler/f18@384828a22f53d828a3140640ca89f5819ada394d
Reviewed-on: https://github.com/flang-compiler/f18/pull/120
Tree-same-pre-rewrite: false
flang/lib/semantics/attr.h
flang/lib/semantics/resolve-names.cc
flang/test/semantics/CMakeLists.txt
flang/test/semantics/symbol01.f90 [new file with mode: 0644]
flang/test/semantics/test_errors.sh
flang/test/semantics/test_symbols.sh [new file with mode: 0755]