9095548553
Add `LazyExpr` class to represent expressions in the symbol table. Initially they contain a pointer to an expression in the parse tree. After name resolution is complete and symbols are filled in in the parse tree, `LazyExpr`s are resolved to `evaluate::Expr<evaluate::SomeType>`. This is done by `ResolveSymbolExprs()`. Change `Bound` and `ParamValue` to save their value as a `LazyExpr`. Change `ObjectEntityDetails` and `TypeParamDetails` to save the initial value as a `LazyExpr`. Eliminate `IntExpr` and `IntConst` classes, which were just place-holders. Add `Clone()` to `ShapeSpec`, `Bound`, `LazyExpr`. Normally they should be moved but in `ObjectEntityDetails::set_shape()` we need to make copies. Save type parameter values in `derivedTypeSpec_`. `typeParamValue_` is not needed. Write out initial values, type parameter values, and bounds to .mod files. Evaluate parameter values in expressions. Make some errors non-fatal so that tests can continue to pass. Original-commit: flang-compiler/f18@b90cadfc53 Reviewed-on: https://github.com/flang-compiler/f18/pull/223 Tree-same-pre-rewrite: false
129 lines
2.9 KiB
CMake
129 lines
2.9 KiB
CMake
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Run tests with test_errors.sh. It compiles the test with f18 and compares
|
|
# actual errors produced with expected ones listed in the source.
|
|
|
|
# These test files have expected errors in the source
|
|
set(ERROR_TESTS
|
|
implicit01.f90
|
|
implicit02.f90
|
|
implicit03.f90
|
|
implicit04.f90
|
|
implicit05.f90
|
|
implicit06.f90
|
|
implicit07.f90
|
|
implicit08.f90
|
|
resolve01.f90
|
|
resolve02.f90
|
|
resolve03.f90
|
|
resolve04.f90
|
|
resolve05.f90
|
|
resolve06.f90
|
|
resolve07.f90
|
|
resolve08.f90
|
|
resolve09.f90
|
|
resolve10.f90
|
|
resolve11.f90
|
|
resolve12.f90
|
|
resolve13.f90
|
|
resolve14.f90
|
|
resolve15.f90
|
|
resolve16.f90
|
|
resolve17.f90
|
|
resolve18.f90
|
|
resolve19.f90
|
|
resolve20.f90
|
|
resolve21.f90
|
|
resolve22.f90
|
|
resolve23.f90
|
|
resolve24.f90
|
|
resolve25.f90
|
|
resolve26.f90
|
|
resolve27.f90
|
|
resolve28.f90
|
|
resolve29.f90
|
|
resolve30.f90
|
|
resolve31.f90
|
|
resolve32.f90
|
|
resolve33.f90
|
|
resolve34.f90
|
|
resolve35.f90
|
|
resolve36.f90
|
|
)
|
|
|
|
# These test files have expected symbols in the source
|
|
set(SYMBOL_TESTS
|
|
symbol01.f90
|
|
symbol02.f90
|
|
symbol03.f90
|
|
symbol04.f90
|
|
symbol05.f90
|
|
symbol06.f90
|
|
symbol07.f90
|
|
symbol08.f90
|
|
symbol09.f90
|
|
)
|
|
|
|
# These test files have expected .mod file contents in the source
|
|
set(MODFILE_TESTS
|
|
modfile01.f90
|
|
modfile02.f90
|
|
modfile03.f90
|
|
modfile04.f90
|
|
modfile05.f90
|
|
modfile06.f90
|
|
modfile07.f90
|
|
modfile08.f90
|
|
modfile09-*.f90
|
|
modfile10.f90
|
|
modfile11.f90
|
|
modfile12.f90
|
|
)
|
|
|
|
set(LABEL_TESTS
|
|
label*.[Ff]90
|
|
)
|
|
|
|
set(DOCONCURRENT_TESTS
|
|
doconcurrent*.[Ff]90
|
|
)
|
|
|
|
set(CANONDO_TESTS
|
|
canondo*.[Ff]90
|
|
)
|
|
|
|
foreach(test ${ERROR_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_errors.sh ${test})
|
|
endforeach()
|
|
|
|
foreach(test ${SYMBOL_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_symbols.sh ${test})
|
|
endforeach()
|
|
|
|
foreach(test ${MODFILE_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_modfile.sh ${test})
|
|
endforeach()
|
|
|
|
foreach(test ${LABEL_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_any.sh ${test})
|
|
endforeach()
|
|
|
|
foreach(test ${CANONDO_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_any.sh ${test})
|
|
endforeach()
|
|
|
|
foreach(test ${DOCONCURRENT_TESTS})
|
|
add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_any.sh ${test})
|
|
endforeach()
|