[flang] Add name resolution tests
authorTim Keith <tkeith@nvidia.com>
Fri, 15 Jun 2018 21:54:34 +0000 (14:54 -0700)
committerTim Keith <tkeith@nvidia.com>
Fri, 15 Jun 2018 21:54:34 +0000 (14:54 -0700)
commit6178163bfd30253c0082191202191bcc4b0f59c4
tree4d08cf2f1c4d8642913ea58e204cdc9029279529
parentaf55ed157b25a972b876bc4a70ddac7679546458
[flang] Add name resolution tests

The Fortran source files in test/semantics all contain expected
errors in comments. The script test_errors.sh compiles a file with
'f18 -fdebug-resolve-names -fparse-only' and compares the actual
errors produced against the expected ones.

The change to resolve15.f90 is necessary because test_errors.sh can't
handle two expected errors for the same source line.

A useful command to run these is 'ctest -R f90 --output-on-failure'.
-R means only run tests with f90 in the name
--output-on-failure prints the output of test_errors.sh when a test
fails, showing the expected and actual messages that differ.

Original-commit: flang-compiler/f18@df18ee7bc95628503b37648d98c5ae25bc74b227
Reviewed-on: https://github.com/flang-compiler/f18/pull/105
flang/test/CMakeLists.txt
flang/test/semantics/CMakeLists.txt [new file with mode: 0644]
flang/test/semantics/resolve15.f90
flang/test/semantics/test_errors.sh [new file with mode: 0755]