From 6c16aa4f67f7938d6bc0ced36d192f5d7f8a3dab Mon Sep 17 00:00:00 2001 From: Patrick McCormick Date: Tue, 25 Feb 2020 16:22:14 -0700 Subject: [PATCH] [flang] A rework of the cmake build components for in and out of tree builds. In general all the basic functionality seems to work and removes some redundancy and more complicated features in favor of borrowing infrastructure from LLVM build configurations. Here's a quick summary of details and remaining issues: * Testing has spanned Ubuntu 18.04 & 19.10, CentOS 7, RHEL 8, and MacOS/darwin. Architectures include x86_64 and Arm. Without access to Window nothing has been tested there yet. * As we change file and directory naming schemes (i.e., capitalization) some odd things can occur on MacOS systems with case preserving but not case senstive file system configurations. Can be painful and certainly something to watch out for as any any such changes continue. * Testing infrastructure still needs to be tuned up and worked on. Note that there do appear to be cases of some tests hanging (on MacOS in particular). They appear unrelated to the build process. * Shared library configurations need testing (and probably fixing). * Tested both standalone and 'in-mono repo' builds. Changes for supporting the mono repo builds will require LLVM-level changes that are straightforward when the time comes. * The configuration contains a work-around for LLVM's C++ standard mode passing down into Flang/F18 builds (i.e., LLVM CMake configuration would force a -std=c++11 flag to show up in command line arguments. The current configuration removes that automatically and is more strict in following new CMake guidelines for enforcing C++17 mode across all the CMake files. * Cleaned up a lot of repetition in the command line arguments. It is likely that more work is still needed to both allow for customization and working around CMake defailts (or those inherited from LLVM's configuration files). On some platforms agressive optimization flags (e.g. -O3) can actually break builds due to the inlining of templates in .cpp source files that then no longer are available for use cases outside those source files (shows up as link errors). Sticking at -O2 appears to fix this. Currently this CMake configuration forces this in release mode but at the cost of stomping on any CMake, or user customized, settings for the release flags. * Made the lit tests non-source directory dependent where appropriate. This is done by configuring certain test shell files to refer to the correct paths whether an in or out of tree build is being performed. These configured files are output in the build directory. A %B substitution is introduced in lit to refer to the build directory, mirroring the %S substitution for the source directory, so that the tests can refer to the configured shell scripts. Co-authored-by: David Truby Original-commit: flang-compiler/f18@d1c7184159b2d3c542a8f36c58a0c817e7506845 Reviewed-on: https://github.com/flang-compiler/f18/pull/1045 --- flang/.gitignore | 2 + flang/CMakeLists.txt | 448 +++++++++++++++------ flang/README.md | 25 -- flang/cmake/modules/AddFlang.cmake | 141 +++++++ flang/cmake/modules/CMakeLists.txt | 74 ++++ flang/cmake/modules/FlangConfig.cmake.in | 13 + flang/include/CMakeLists.txt | 1 + flang/include/flang/Version.inc.in | 5 + flang/lib/CMakeLists.txt | 8 - flang/lib/Common/CMakeLists.txt | 9 +- flang/lib/Decimal/CMakeLists.txt | 9 +- flang/lib/Evaluate/CMakeLists.txt | 9 +- flang/lib/Parser/CMakeLists.txt | 9 +- flang/lib/Semantics/CMakeLists.txt | 9 +- flang/test/CMakeLists.txt | 16 +- flang/test/Semantics/CMakeLists.txt | 1 + flang/test/Semantics/allocate01.f90 | 2 +- flang/test/Semantics/allocate02.f90 | 2 +- flang/test/Semantics/allocate03.f90 | 2 +- flang/test/Semantics/allocate04.f90 | 2 +- flang/test/Semantics/allocate05.f90 | 2 +- flang/test/Semantics/allocate06.f90 | 2 +- flang/test/Semantics/allocate07.f90 | 2 +- flang/test/Semantics/allocate08.f90 | 2 +- flang/test/Semantics/allocate09.f90 | 2 +- flang/test/Semantics/allocate10.f90 | 2 +- flang/test/Semantics/allocate11.f90 | 2 +- flang/test/Semantics/allocate12.f90 | 2 +- flang/test/Semantics/allocate13.f90 | 2 +- flang/test/Semantics/altreturn01.f90 | 2 +- flang/test/Semantics/altreturn02.f90 | 2 +- flang/test/Semantics/altreturn03.f90 | 2 +- flang/test/Semantics/altreturn04.f90 | 2 +- flang/test/Semantics/altreturn05.f90 | 2 +- flang/test/Semantics/assign01.f90 | 2 +- flang/test/Semantics/assign02.f90 | 2 +- flang/test/Semantics/assign03.f90 | 2 +- flang/test/Semantics/assign04.f90 | 2 +- flang/test/Semantics/bad-forward-type.f90 | 2 +- flang/test/Semantics/bindings01.f90 | 2 +- flang/test/Semantics/block-data01.f90 | 2 +- flang/test/Semantics/blockconstruct01.f90 | 2 +- flang/test/Semantics/blockconstruct02.f90 | 2 +- flang/test/Semantics/blockconstruct03.f90 | 2 +- flang/test/Semantics/c_f_pointer.f90 | 2 +- flang/test/Semantics/call01.f90 | 2 +- flang/test/Semantics/call02.f90 | 2 +- flang/test/Semantics/call03.f90 | 2 +- flang/test/Semantics/call04.f90 | 2 +- flang/test/Semantics/call05.f90 | 2 +- flang/test/Semantics/call06.f90 | 2 +- flang/test/Semantics/call07.f90 | 2 +- flang/test/Semantics/call08.f90 | 2 +- flang/test/Semantics/call09.f90 | 2 +- flang/test/Semantics/call10.f90 | 2 +- flang/test/Semantics/call11.f90 | 2 +- flang/test/Semantics/call12.f90 | 2 +- flang/test/Semantics/call13.f90 | 2 +- flang/test/Semantics/call14.f90 | 2 +- flang/test/Semantics/call15.f90 | 2 +- flang/test/Semantics/canondo16.f90 | 4 +- flang/test/Semantics/coarrays01.f90 | 2 +- flang/test/Semantics/complex01.f90 | 2 +- flang/test/Semantics/computed-goto01.f90 | 2 +- flang/test/Semantics/computed-goto02.f90 | 2 +- flang/test/Semantics/critical01.f90 | 2 +- flang/test/Semantics/critical02.f90 | 2 +- flang/test/Semantics/critical03.f90 | 2 +- flang/test/Semantics/data01.f90 | 2 +- flang/test/Semantics/data02.f90 | 2 +- flang/test/Semantics/deallocate01.f90 | 2 +- flang/test/Semantics/deallocate04.f90 | 2 +- flang/test/Semantics/deallocate05.f90 | 2 +- flang/test/Semantics/doconcurrent01.f90 | 2 +- flang/test/Semantics/doconcurrent05.f90 | 2 +- flang/test/Semantics/doconcurrent06.f90 | 2 +- flang/test/Semantics/doconcurrent08.f90 | 2 +- flang/test/Semantics/dosemantics01.f90 | 2 +- flang/test/Semantics/dosemantics02.f90 | 2 +- flang/test/Semantics/dosemantics03.f90 | 2 +- flang/test/Semantics/dosemantics04.f90 | 2 +- flang/test/Semantics/dosemantics05.f90 | 2 +- flang/test/Semantics/dosemantics06.f90 | 2 +- flang/test/Semantics/dosemantics07.f90 | 2 +- flang/test/Semantics/dosemantics08.f90 | 2 +- flang/test/Semantics/dosemantics09.f90 | 2 +- flang/test/Semantics/dosemantics10.f90 | 2 +- flang/test/Semantics/dosemantics11.f90 | 2 +- flang/test/Semantics/dosemantics12.f90 | 2 +- flang/test/Semantics/entry01.f90 | 2 +- flang/test/Semantics/equivalence01.f90 | 2 +- flang/test/Semantics/expr-errors01.f90 | 2 +- flang/test/Semantics/expr-errors02.f90 | 2 +- flang/test/Semantics/forall01.f90 | 2 +- flang/test/Semantics/if_arith01.f90 | 2 +- flang/test/Semantics/if_arith02.f90 | 2 +- flang/test/Semantics/if_arith03.f90 | 2 +- flang/test/Semantics/if_arith04.f90 | 2 +- flang/test/Semantics/if_construct01.f90 | 2 +- flang/test/Semantics/if_construct02.f90 | 2 +- flang/test/Semantics/if_stmt01.f90 | 2 +- flang/test/Semantics/if_stmt02.f90 | 2 +- flang/test/Semantics/if_stmt03.f90 | 2 +- flang/test/Semantics/implicit01.f90 | 2 +- flang/test/Semantics/implicit02.f90 | 2 +- flang/test/Semantics/implicit03.f90 | 2 +- flang/test/Semantics/implicit04.f90 | 2 +- flang/test/Semantics/implicit05.f90 | 2 +- flang/test/Semantics/implicit06.f90 | 2 +- flang/test/Semantics/implicit07.f90 | 2 +- flang/test/Semantics/implicit08.f90 | 2 +- flang/test/Semantics/init01.f90 | 2 +- flang/test/Semantics/int-literals.f90 | 2 +- flang/test/Semantics/io01.f90 | 2 +- flang/test/Semantics/io02.f90 | 2 +- flang/test/Semantics/io03.f90 | 2 +- flang/test/Semantics/io04.f90 | 2 +- flang/test/Semantics/io05.f90 | 2 +- flang/test/Semantics/io06.f90 | 2 +- flang/test/Semantics/io07.f90 | 2 +- flang/test/Semantics/io08.f90 | 2 +- flang/test/Semantics/io09.f90 | 2 +- flang/test/Semantics/io10.f90 | 2 +- flang/test/Semantics/kinds02.f90 | 2 +- flang/test/Semantics/kinds04.f90 | 2 +- flang/test/Semantics/misc-declarations.f90 | 2 +- flang/test/Semantics/namelist01.f90 | 2 +- flang/test/Semantics/null01.f90 | 2 +- flang/test/Semantics/nullify01.f90 | 2 +- flang/test/Semantics/nullify02.f90 | 2 +- flang/test/Semantics/omp-atomic.f90 | 2 +- flang/test/Semantics/omp-clause-validity01.f90 | 2 +- flang/test/Semantics/omp-declarative-directive.f90 | 2 +- flang/test/Semantics/omp-device-constructs.f90 | 2 +- flang/test/Semantics/omp-loop-association.f90 | 2 +- flang/test/Semantics/omp-nested01.f90 | 2 +- flang/test/Semantics/omp-resolve01.f90 | 2 +- flang/test/Semantics/omp-resolve02.f90 | 2 +- flang/test/Semantics/omp-resolve03.f90 | 2 +- flang/test/Semantics/omp-resolve04.f90 | 2 +- flang/test/Semantics/omp-resolve05.f90 | 2 +- flang/test/Semantics/resolve01.f90 | 2 +- flang/test/Semantics/resolve02.f90 | 2 +- flang/test/Semantics/resolve03.f90 | 2 +- flang/test/Semantics/resolve04.f90 | 2 +- flang/test/Semantics/resolve05.f90 | 2 +- flang/test/Semantics/resolve06.f90 | 2 +- flang/test/Semantics/resolve07.f90 | 2 +- flang/test/Semantics/resolve08.f90 | 2 +- flang/test/Semantics/resolve09.f90 | 2 +- flang/test/Semantics/resolve10.f90 | 2 +- flang/test/Semantics/resolve11.f90 | 2 +- flang/test/Semantics/resolve12.f90 | 2 +- flang/test/Semantics/resolve13.f90 | 2 +- flang/test/Semantics/resolve14.f90 | 2 +- flang/test/Semantics/resolve15.f90 | 2 +- flang/test/Semantics/resolve16.f90 | 2 +- flang/test/Semantics/resolve17.f90 | 2 +- flang/test/Semantics/resolve18.f90 | 2 +- flang/test/Semantics/resolve19.f90 | 2 +- flang/test/Semantics/resolve20.f90 | 2 +- flang/test/Semantics/resolve21.f90 | 2 +- flang/test/Semantics/resolve22.f90 | 2 +- flang/test/Semantics/resolve23.f90 | 2 +- flang/test/Semantics/resolve24.f90 | 2 +- flang/test/Semantics/resolve25.f90 | 2 +- flang/test/Semantics/resolve26.f90 | 2 +- flang/test/Semantics/resolve27.f90 | 2 +- flang/test/Semantics/resolve28.f90 | 2 +- flang/test/Semantics/resolve29.f90 | 2 +- flang/test/Semantics/resolve30.f90 | 2 +- flang/test/Semantics/resolve31.f90 | 2 +- flang/test/Semantics/resolve32.f90 | 2 +- flang/test/Semantics/resolve33.f90 | 2 +- flang/test/Semantics/resolve34.f90 | 2 +- flang/test/Semantics/resolve35.f90 | 2 +- flang/test/Semantics/resolve36.f90 | 3 +- flang/test/Semantics/resolve37.f90 | 2 +- flang/test/Semantics/resolve38.f90 | 2 +- flang/test/Semantics/resolve39.f90 | 2 +- flang/test/Semantics/resolve40.f90 | 2 +- flang/test/Semantics/resolve41.f90 | 2 +- flang/test/Semantics/resolve42.f90 | 2 +- flang/test/Semantics/resolve43.f90 | 2 +- flang/test/Semantics/resolve44.f90 | 2 +- flang/test/Semantics/resolve45.f90 | 2 +- flang/test/Semantics/resolve46.f90 | 2 +- flang/test/Semantics/resolve47.f90 | 2 +- flang/test/Semantics/resolve48.f90 | 2 +- flang/test/Semantics/resolve49.f90 | 2 +- flang/test/Semantics/resolve50.f90 | 2 +- flang/test/Semantics/resolve51.f90 | 2 +- flang/test/Semantics/resolve52.f90 | 2 +- flang/test/Semantics/resolve53.f90 | 2 +- flang/test/Semantics/resolve54.f90 | 2 +- flang/test/Semantics/resolve55.f90 | 2 +- flang/test/Semantics/resolve56.f90 | 2 +- flang/test/Semantics/resolve57.f90 | 2 +- flang/test/Semantics/resolve58.f90 | 2 +- flang/test/Semantics/resolve59.f90 | 2 +- flang/test/Semantics/resolve60.f90 | 2 +- flang/test/Semantics/resolve61.f90 | 2 +- flang/test/Semantics/resolve62.f90 | 2 +- flang/test/Semantics/resolve63.f90 | 2 +- flang/test/Semantics/resolve64.f90 | 2 +- flang/test/Semantics/resolve65.f90 | 2 +- flang/test/Semantics/resolve66.f90 | 2 +- flang/test/Semantics/resolve67.f90 | 2 +- flang/test/Semantics/resolve68.f90 | 2 +- flang/test/Semantics/resolve69.f90 | 2 +- flang/test/Semantics/resolve70.f90 | 2 +- flang/test/Semantics/resolve71.f90 | 2 +- flang/test/Semantics/resolve72.f90 | 2 +- flang/test/Semantics/resolve73.f90 | 2 +- flang/test/Semantics/resolve74.f90 | 2 +- flang/test/Semantics/resolve75.f90 | 2 +- flang/test/Semantics/resolve76.f90 | 2 +- flang/test/Semantics/resolve77.f90 | 2 +- flang/test/Semantics/resolve78.f90 | 2 +- flang/test/Semantics/resolve79.f90 | 2 +- flang/test/Semantics/resolve80.f90 | 2 +- flang/test/Semantics/resolve81.f90 | 2 +- flang/test/Semantics/resolve82.f90 | 2 +- flang/test/Semantics/resolve83.f90 | 2 +- flang/test/Semantics/resolve84.f90 | 2 +- flang/test/Semantics/resolve85.f90 | 2 +- flang/test/Semantics/separate-mp01.f90 | 2 +- flang/test/Semantics/separate-mp02.f90 | 2 +- flang/test/Semantics/stop01.f90 | 2 +- flang/test/Semantics/structconst01.f90 | 2 +- flang/test/Semantics/structconst02.f90 | 2 +- flang/test/Semantics/structconst03.f90 | 2 +- flang/test/Semantics/structconst04.f90 | 2 +- flang/test/Semantics/test_any.sh | 4 +- .../{test_errors.sh => test_errors.sh.in} | 4 +- flang/test/lit.cfg.py | 4 +- flang/tools/CMakeLists.txt | 1 + flang/tools/f18-parse-demo/CMakeLists.txt | 13 + .../{f18 => f18-parse-demo}/f18-parse-demo.cpp | 0 .../{f18 => f18-parse-demo}/stub-evaluate.cpp | 0 flang/tools/f18/CMakeLists.txt | 62 +-- flang/tools/f18/{flang.sh => flang.sh.in} | 2 +- flang/unittests/CMakeLists.txt | 8 - flang/unittests/Decimal/CMakeLists.txt | 11 +- flang/unittests/Evaluate/CMakeLists.txt | 9 +- flang/unittests/Runtime/CMakeLists.txt | 19 +- 246 files changed, 857 insertions(+), 496 deletions(-) create mode 100644 flang/cmake/modules/AddFlang.cmake create mode 100644 flang/cmake/modules/CMakeLists.txt create mode 100644 flang/cmake/modules/FlangConfig.cmake.in create mode 100644 flang/include/CMakeLists.txt create mode 100644 flang/include/flang/Version.inc.in create mode 100644 flang/test/Semantics/CMakeLists.txt rename flang/test/Semantics/{test_errors.sh => test_errors.sh.in} (93%) create mode 100644 flang/tools/f18-parse-demo/CMakeLists.txt rename flang/tools/{f18 => f18-parse-demo}/f18-parse-demo.cpp (100%) rename flang/tools/{f18 => f18-parse-demo}/stub-evaluate.cpp (100%) rename flang/tools/f18/{flang.sh => flang.sh.in} (95%) diff --git a/flang/.gitignore b/flang/.gitignore index c45f199..4da4ee1 100644 --- a/flang/.gitignore +++ b/flang/.gitignore @@ -17,3 +17,5 @@ CMakeCache.txt */*/Makefile cmake_install.cmake formatted +.DS_Store +.vs_code diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 8883fb7..54c5d52 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -1,97 +1,140 @@ -#===-- CMakeLists.txt ------------------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - cmake_minimum_required(VERSION 3.9.0) -option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) +# RPATH settings on macOS do not affect INSTALL_NAME. +if (POLICY CMP0068) + cmake_policy(SET CMP0068 NEW) + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) +endif() -# Pass -DGCC=... to cmake to use a specific gcc installation. -if( GCC ) - set(CMAKE_CXX_COMPILER "${GCC}/bin/g++") - set(CMAKE_CC_COMPILER "${GCC}/bin/gcc") - set(CMAKE_BUILD_RPATH "${GCC}/lib64") - set(CMAKE_INSTALL_RPATH "${GCC}/lib64") -endif() -if(BUILD_WITH_CLANG) - file(TO_CMAKE_PATH "${BUILD_WITH_CLANG}" CLANG_PATH) - set(CMAKE_CXX_COMPILER "${CLANG_PATH}/bin/clang++") - set(CMAKE_CC_COMPILER "${CLANG_PATH}/bin/clang") - if(GCC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --gcc-toolchain=${GCC}") - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstring-conversion") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcovered-switch-default") +# Include file check macros honor CMAKE_REQUIRED_LIBRARIES. +if(POLICY CMP0075) + cmake_policy(SET CMP0075 NEW) endif() -# Set RPATH in every executable, overriding the default setting. -# If you set this first variable back to true (the default), -# also set the second one. -set(CMAKE_SKIP_BUILD_RPATH false) -set(CMAKE_BUILD_WITH_INSTALL_RPATH false) +# option() honors normal variables. +if (POLICY CMP0077) + cmake_policy(SET CMP0077 NEW) +endif() -set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_INSTALL_RPATH}") +option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) -# Reminder: Setting CMAKE_CXX_COMPILER must be done before calling project() +# Flang requires C++17. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +set(CMAKE_CXX_EXTENSIONS OFF) -project(f18 CXX) +set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -if( NOT CMAKE_BUILD_TYPE ) - set( CMAKE_BUILD_TYPE Debug ) +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE) + message(FATAL_ERROR "In-source builds are not allowed. \ + Please create a directory and run cmake from there,\ + passing the path to this source directory as the last argument.\ + This process created the file `CMakeCache.txt' and the directory\ + `CMakeFiles'. Please delete them.") endif() -message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}" ) +# Add Flang-centric modules to cmake path. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") +include(AddFlang) -find_package(LLVM REQUIRED CONFIG) -message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} in ${LLVM_DIR}") -# If LLVM links to zlib we need the imported targets so we can too. -if(LLVM_ENABLE_ZLIB) - find_package(ZLIB REQUIRED) -endif() +# Check for a standalone build and configure as appropriate from +# there. +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +message("Building Flang as a standalone project.") +project(Flang) + + set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + if (NOT MSVC_IDE) + set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS} + CACHE BOOL "Enable assertions") + # Assertions follow llvm's configuration. + mark_as_advanced(LLVM_ENABLE_ASSERTIONS) + endif() + + # We need a pre-built/installed version of LLVM. + find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}") + list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) -list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) + # If LLVM links to zlib we need the imported targets so we can too. + if(LLVM_ENABLE_ZLIB) + find_package(ZLIB REQUIRED) + endif() + + include(CMakeParseArguments) + include(AddLLVM) + include(HandleLLVMOptions) + include(VersionFromVCS) + + if(LINK_WITH_FIR) + include(TableGen) + include(AddMLIR) + find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR} + NO_DEFAULT_PATH) + endif() + + option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) + option(LLVM_INSTALL_TOOLCHAIN_ONLY + "Only include toolchain files in the 'install' target." OFF) + option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN + "Set to ON to force using an old, unsupported host toolchain." OFF) -include(AddLLVM) -# Get names for the LLVM libraries -# -# The full list of LLVM components can be obtained with -# -# llvm-config --components -# -# Similarly, the (static) libraries corresponding to some -# components (default is 'all') can be obtained with -# -# llvm-config --libs --link-static [component ...] -# -# See also -# http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project -# https://stackoverflow.com/questions/41924375/llvm-how-to-specify-all-link-libraries-as-input-to-llvm-map-components-to-libna -# https://stackoverflow.com/questions/33948633/how-do-i-link-when-building-with-llvm-libraries + # Add LLVM include files as if they were SYSTEM because there are complex unused + # parameter issues that may or may not appear depending on the environments and + # compilers (ifdefs are involved). This allows warnings from LLVM headers to be + # ignored while keeping -Wunused-parameter a fatal error inside f18 code base. + # This may have to be fine-tuned if flang headers are consider part of this + # LLVM_INCLUDE_DIRS when merging in the monorepo (Warning from flang headers + # should not be suppressed). + include_directories(SYSTEM ${LLVM_INCLUDE_DIRS}) + add_definitions(${LLVM_DEFINITIONS}) -# Add LLVM include files as if they were SYSTEM because there are complex unused -# parameter issues that may or may not appear depending on the environments and -# compilers (ifdefs are involved). This allows warnings from LLVM headers to be -# ignored while keeping -Wunused-parameter a fatal error inside f18 code base. -# This may have to be fine-tuned if flang headers are consider part of this -# LLVM_INCLUDE_DIRS when merging in the monorepo (Warning from flang headers -# should not be suppressed). -include_directories(SYSTEM ${LLVM_INCLUDE_DIRS}) -add_definitions(${LLVM_DEFINITIONS}) + # LLVM's cmake configuration files currently sneak in a c++11 flag. + # We look for it here and remove it from Flang's compile flags to + # avoid some mixed compilation flangs (e.g. -std=c++11 ... -std=c++17). + if (DEFINED LLVM_CXX_STD) + message("LLVM configuration set a C++ standard: ${LLVM_CXX_STD}") + if (NOT LLVM_CXX_STD EQUAL "c++17") + message("Flang: Overriding LLVM's 'cxx_std' setting...") + message(" removing '-std=${LLVM_CXX_STD}'") + message(" CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'") + string(REPLACE " -std=${LLVM_CXX_STD}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + message(" [NEW] CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'") + endif() + endif() -# LLVM_LIT_EXTERNAL store in cache so it could be used by AddLLVM.cmake -set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE STRING "Command used to spawn lit") + link_directories("${LLVM_LIBRARY_DIR}") + + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + + set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}") + set(LLVM_EXTERNAL_LIT "${LLVM_TOOLS_BINARY_DIR}/llvm-lit" CACHE STRING "Command used to spawn lit") + + option(FLANG_INCLUDE_TESTS + "Generate build targets for the Flang unit tests." + ON) + add_custom_target(check-all DEPENDS check-flang) +else() + option(FLANG_INCLUDE_TESTS + "Generate build targets for the Flang unit tests." + ${LLVM_INCLUDE_TESTS}) + set(FLANG_BINARY_DIR ${CMAKE_BINARY_DIR}/tools/flang) + set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}") + if (LINK_WITH_FIR) + set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --src-root + set(MLIR_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --includedir + set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include) + set(MLIR_TABLEGEN_EXE $) + include_directories(SYSTEM ${MLIR_INCLUDE_DIR}) + include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR}) + endif() +endif() if(LINK_WITH_FIR) - include(TableGen) - include(AddMLIR) - find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) # tco tool and FIR lib output directories set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin) set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib) @@ -102,62 +145,227 @@ if(LINK_WITH_FIR) message(STATUS "LLVM libraries: ${LLVM_COMMON_LIBS}") endif() -if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(BUILD_WITH_CLANG_LIBRARIES) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++ -I${BUILD_WITH_CLANG_LIBRARIES}/include/c++/v1 -DCLANG_LIBRARIES") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -Wl,-rpath,${BUILD_WITH_CLANG_LIBRARIES}/lib -L${BUILD_WITH_CLANG_LIBRARIES}/lib") - else() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++") - endif() - if(GCC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --gcc-toolchain=${GCC}") - endif() - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-qual") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wimplicit-fallthrough") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdelete-non-virtual-dtor") - set(CMAKE_CXX_FLAGS_RELEASE "-O2") - set(CMAKE_CXX_FLAGS_MINSIZEREL "-O2 '-DCHECK=(void)'") - set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUGF18") - - # Building shared libraries is death on performance with GCC by default - # due to the need to preserve the right to override external entry points - # at dynamic link time. -fno-semantic-interposition waives that right and - # recovers a little bit of that performance. - if (BUILD_SHARED_LIBS AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-semantic-interposition") - endif() +# Add Flang-centric modules to cmake path. +include_directories(BEFORE + ${FLANG_BINARY_DIR}/include + ${FLANG_SOURCE_DIR}/include) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + +if (NOT DEFAULT_SYSROOT) + set(DEFAULT_SYSROOT "" CACHE PATH + "The to use for the system root for all compiler invocations (--sysroot=).") +endif() + +if (NOT ENABLE_LINKER_BUILD_ID) + set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld") endif() +set(FLANG_DEFAULT_LINKER "" CACHE STRING + "Default linker to use (linker name or absolute path, empty for platform default)") + +set(FLANG_DEFAULT_RTLIB "" CACHE STRING + "Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.") + +if (NOT(FLANG_DEFAULT_RTLIB STREQUAL "")) + message(WARNING "Resetting Flang's default runtime library to use platform default.") + set(FLANG_DEFAULT_RTLIB "" CACHE STRING + "Default runtime library to use (empty for platform default)" FORCE) +endif() + + + +set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") +# Override LLVM versioning for now... set(FLANG_VERSION_MAJOR "0") set(FLANG_VERSION_MINOR "1") set(FLANG_VERSION_PATCHLEVEL "0") + + +if (NOT DEFINED FLANG_VERSION_MAJOR) + set(FLANG_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) +endif() + +if (NOT DEFINED FLANG_VERSION_MINOR) + set(FLANG_VERSION_MINOR ${LLVM_VERSION_MINOR}) +endif() + +if (NOT DEFINED FLANG_VERSION_PATCHLEVEL) + set(FLANG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH}) +endif() + +# Unlike PACKAGE_VERSION, FLANG_VERSION does not include LLVM_VERSION_SUFFIX. set(FLANG_VERSION "${FLANG_VERSION_MAJOR}.${FLANG_VERSION_MINOR}.${FLANG_VERSION_PATCHLEVEL}") -message(STATUS "FLANG version: ${FLANG_VERSION}") +message(STATUS "Flang version: ${FLANG_VERSION}") +# Flang executable version information +set(FLANG_EXECUTABLE_VERSION + "${FLANG_VERSION_MAJOR}" CACHE STRING + "Major version number to appended to the flang executable name.") +set(LIBFLANG_LIBRARY_VERSION + "${FLANG_VERSION_MAJOR}" CACHE STRING + "Major version number to appended to the libflang library.") -set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) -set(FLANG_TOOLS_DIR ${FLANG_BINARY_DIR}/tools/f18/bin) +mark_as_advanced(FLANG_EXECUTABLE_VERSION LIBFLANG_LIBRARY_VERSION) -include_directories(BEFORE - ${FLANG_BINARY_DIR}/include - ${FLANG_SOURCE_DIR}/include - ) +set(FLANG_VENDOR ${PACKAGE_VENDOR} CACHE STRING + "Vendor-specific Flang version information.") +set(FLANG_VENDOR_UTI "org.llvm.flang" CACHE STRING + "Vendor-specific uti.") -enable_testing() +if (FLANG_VENDOR) + add_definitions(-DFLANG_VENDOR="${FLANG_VENDOR} ") +endif() -add_subdirectory(include/flang) -add_subdirectory(lib) -add_subdirectory(runtime) -add_subdirectory(unittests) -add_subdirectory(tools) -add_subdirectory(test) +set(FLANG_REPOSITORY_STRING "" CACHE STRING + "Vendor-specific text for showing the repository the source is taken from.") +if (FLANG_REPOSITORY_STRING) + add_definitions(-DFLANG_REPOSITORY_STRING="${FLANG_REPOSITORY_STRING}") +endif() +# Configure Flang's Version.inc file. +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/include/flang/Version.inc.in + ${CMAKE_CURRENT_BINARY_DIR}/include/flang/Version.inc) +# Configure Flang's version info header file. configure_file( ${FLANG_SOURCE_DIR}/include/flang/Config/config.h.cmake ${FLANG_BINARY_DIR}/include/flang/Config/config.h) + +# Add global F18 flags. +set(CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions -pedantic -Wall -Wextra -Werror -Wcast-qual -Wimplicit-fallthrough -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS}") + +# Builtin check_cxx_compiler_flag doesn't seem to work correctly +macro(check_compiler_flag flag resultVar) + unset(${resultVar} CACHE) + check_cxx_compiler_flag("${flag}" ${resultVar}) +endmacro() + +check_compiler_flag("-Werror -Wno-deprecated-copy" CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG) +if (CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") +endif() +check_compiler_flag("-Wstring-conversion" CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG) +if (CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-conversion") +endif() + +# Add appropriate flags for GCC +if (LLVM_COMPILER_IS_GCC_COMPATIBLE) + + if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-semantic-interposition") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Wstring-conversion \ + -Wcovered-switch-default") + endif() # Clang. + + check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) + if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types") + endif() + + # Add to or adjust build type flags. + # + # TODO: This needs some extra thought. CMake's default for release builds + # is -O3, which can cause build failures on certain platforms (and compilers) + # with the current code base -- some templated functions are inlined and don't + # become available at link time when using -O3 (with Clang under MacOS/darwin). + # If we reset CMake's default flags we also clobber any user provided settings; + # make it difficult to customize a build in this regard... The setup below + # has this side effect but enables successful builds across multiple platforms + # in release mode... + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUGF18") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DCHECK=\"(void)\"") # do we need -O2 here? + set(CMAKE_CXX_FLAGS_RELEASE "-O2") + + # Building shared libraries is bad for performance with GCC by default + # due to the need to preserve the right to override external entry points + if (BUILD_SHARED_LIBS AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-semantic-interposition") + endif() + +endif() + +list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) + +# Determine HOST_LINK_VERSION on Darwin. +set(HOST_LINK_VERSION) +if (APPLE) + set(LD_V_OUTPUT) + execute_process( + COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1" + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE LD_V_OUTPUT) + if (NOT HAD_ERROR) + if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*") + string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT}) + elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*") + string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT}) + endif() + else() + message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}") + endif() +endif() + +include(CMakeParseArguments) +include(AddFlang) + + +add_subdirectory(include) +add_subdirectory(lib) +add_subdirectory(cmake/modules) + +option(FLANG_BUILD_TOOLS + "Build the Flang tools. If OFF, just generate build targets." ON) +if (FLANG_BUILD_TOOLS) + add_subdirectory(tools) +endif() +add_subdirectory(runtime) + +if (FLANG_INCLUDE_TESTS) + enable_testing() + add_subdirectory(test) + add_subdirectory(unittests) +endif() + +# TODO: Add doxygen support. +#option(FLANG_INCLUDE_DOCS "Generate build targets for the Flang docs." +# ${LLVM_INCLUDE_DOCS}) +#if (FLANG_INCLUDE_DOCS) +# add_subdirectory(documentation) +#endif() + +# Custom target to install Flang libraries. +add_custom_target(flang-libraries) +set_target_properties(flang-libraries PROPERTIES FOLDER "Misc") + +if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-flang-libraries + DEPENDS flang-libraries + COMPONENT flang-libraries) +endif() + +get_property(FLANG_LIBS GLOBAL PROPERTY FLANG_LIBS) +if (FLANG_LIBS) + list(REMOVE_DUPLICATES FLANG_LIBS) + foreach(lib ${FLANG_LIBS}) + add_dependencies(flang-libraries ${lib}) + if (NOT LLVM_ENABLE_IDE) + add_dependencies(install-flang-libraries install-${lib}) + endif() + endforeach() +endif() + +if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/flang + DESTINATION include + COMPONENT flang-headers + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" + PATTERN "*.inc" + PATTERN "*.td" + PATTERN "config.h" EXCLUDE + PATTERN ".git" EXCLUDE + PATTERN "CMakeFiles" EXCLUDE) +endif() diff --git a/flang/README.md b/flang/README.md index d8e2cbd..926abc0 100644 --- a/flang/README.md +++ b/flang/README.md @@ -150,15 +150,6 @@ or ``` CXX=/opt/gcc-7.2/bin/g++-7.2 cmake ... ``` -There's a third option! -The CMakeList.txt file uses the variable GCC -as the path to the bin directory containing the C++ compiler. - -GCC can be defined on the cmake command line -where `` is the path to a GCC installation with bin, lib, etc: -``` -cmake -DGCC= ... -``` ### Building f18 with clang @@ -166,27 +157,11 @@ To build f18 with clang, cmake needs to know how to find clang++ and the GCC library and tools that were used to build clang++. -The CMakeList.txt file expects either CXX or BUILD_WITH_CLANG to be set. - CXX should include the full path to clang++ or clang++ should be found on your PATH. ``` export CXX=clang++ ``` -BUILD_WITH_CLANG can be defined on the cmake command line -where `` -is the path to a clang installation with bin, lib, etc: -``` -cmake -DBUILD_WITH_CLANG= -``` -Or GCC can be defined on the f18 cmake command line -where `` is the path to a GCC installation with bin, lib, etc: -``` -cmake -DGCC= ... -``` -To use f18 after it is built, -the environment variables PATH and LD_LIBRARY_PATH -must be set to use GCC and its associated libraries. ### Installation Directory diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake new file mode 100644 index 0000000..84610a6 --- /dev/null +++ b/flang/cmake/modules/AddFlang.cmake @@ -0,0 +1,141 @@ +macro(set_flang_windows_version_resource_properties name) + if (DEFINED windows_resource_file) + set_windows_version_resource_properties(${name} ${windows_resource_file} + VERSION_MAJOR ${FLANG_VERSION_MAJOR} + VERSION_MINOR ${FLANG_VERSION_MINOR} + VERSION_PATCHLEVEL ${FLANG_VERSION_PATCHLEVEL} + VERSION_STRING "${FLANG_VERSION} (${BACKEND_PACKAGE_STRING})" + PRODUCT_NAME "flang") + endif() +endmacro() + +macro(add_flang_subdirectory name) + add_llvm_subdirectory(FLANG TOOL ${name}) +endmacro() + +macro(add_flang_library name) + cmake_parse_arguments(ARG + "SHARED" + "" + "ADDITIONAL_HEADERS" + ${ARGN}) + set(srcs) + if (MSVC_IDE OR XCODE) + # Add public headers + file(RELATIVE_PATH lib_path + ${FLANG_SOURCE_DIR}/lib/ + ${CMAKE_CURRENT_SOURCE_DIR}) + if(NOT lib_path MATCHES "^[.][.]") + file( GLOB_RECURSE headers + ${FLANG_SOURCE_DIR}/include/flang/${lib_path}/*.h + ${FLANG_SOURCE_DIR}/include/flang/${lib_path}/*.def) + set_source_files_properties(${headers} PROPERTIES HEADER_FILE_ONLY ON) + + if (headers) + set(srcs ${headers}) + endif() + endif() + endif(MSVC_IDE OR XCODE) + + if (srcs OR ARG_ADDITIONAL_HEADERS) + set(srcs + ADDITIONAL_HEADERS + ${srcs} + ${ARG_ADDITIONAL_HEADERS}) # It may contain unparsed unknown args. + + endif() + + if (ARG_SHARED) + set(LIBTYPE SHARED) + else() + # llvm_add_library ignores BUILD_SHARED_LIBS if STATIC is explicitly set, + # so we need to handle it here. + if (BUILD_SHARED_LIBS) + set(LIBTYPE SHARED OBJECT) + else() + set(LIBTYPE STATIC OBJECT) + endif() + set_property(GLOBAL APPEND PROPERTY FLANG_STATIC_LIBS ${name}) + endif() + + llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs}) + + if (TARGET ${name}) + target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS}) + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang") + set(export_to_flangtargets) + if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR + "flang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR + NOT LLVM_DISTRIBUTION_COMPONENTS) + set(export_to_flangtargets EXPORT FlangTargets) + set_property(GLOBAL PROPERTY FLANG_HAS_EXPORTS True) + endif() + + install(TARGETS ${name} + COMPONENT ${name} + ${export_to_flangtargets} + LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} + ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + RUNTIME DESTINATION bin) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} + DEPENDS ${name} + COMPONENT ${name}) + endif() + + set_property(GLOBAL APPEND PROPERTY FLANG_LIBS ${name}) + endif() + set_property(GLOBAL APPEND PROPERTY FLANG_EXPORTS ${name}) + else() + # Add empty "phony" target + add_custom_target(${name}) + endif() + + set_target_properties(${name} PROPERTIES FOLDER "Flang libraries") + set_flang_windows_version_resource_properties(${name}) +endmacro(add_flang_library) + +macro(add_flang_executable name) + add_llvm_executable(${name} ${ARGN}) + set_target_properties(${name} PROPERTIES FOLDER "Flang executables") + set_flang_windows_version_resource_properties(${name}) +endmacro(add_flang_executable) + +macro(add_flang_tool name) + if (NOT FLANG_BUILD_TOOLS) + set(EXCLUDE_FROM_ALL ON) + endif() + + add_flang_executable(${name} ${ARGN}) + add_dependencies(${name} flang-resource-headers) + + if (FLANG_BUILD_TOOLS) + set(export_to_flangtargets) + if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR + NOT LLVM_DISTRIBUTION_COMPONENTS) + set(export_to_flangtargets EXPORT FlangTargets) + set_property(GLOBAL PROPERTY FLANG_HAS_EXPORTS True) + endif() + + install(TARGETS ${name} + ${export_to_flangtargets} + RUNTIME DESTINATION bin + COMPONENT ${name}) + + if(NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-${name} + DEPENDS ${name} + COMPONENT ${name}) + endif() + set_property(GLOBAL APPEND PROPERTY FLANG_EXPORTS ${name}) + endif() +endmacro() + +macro(add_flang_symlink name dest) + add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE) + # Always generate install targets + llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE) +endmacro() + diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt new file mode 100644 index 0000000..4822124 --- /dev/null +++ b/flang/cmake/modules/CMakeLists.txt @@ -0,0 +1,74 @@ +# Generate a list of CMake library targets so that other CMake projects can +# link against them. LLVM calls its version of this file LLVMExports.cmake, but +# the usual CMake convention seems to be ${Project}Targets.cmake. +set(FLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/flang) +set(flang_cmake_builddir "${CMAKE_BINARY_DIR}/${FLANG_INSTALL_PACKAGE_DIR}") + +# Keep this in sync with llvm/cmake/CMakeLists.txt! +set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) +set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") + +get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS) +export(TARGETS ${FLANG_EXPORTS} FILE ${flang_cmake_builddir}/FlangTargets.cmake) + +# Generate FlangConfig.cmake for the build tree. +set(FLANG_CONFIG_CMAKE_DIR "${flang_cmake_builddir}") +set(FLANG_CONFIG_LLVM_CMAKE_DIR "${llvm_cmake_builddir}") +set(FLANG_CONFIG_EXPORTS_FILE "${flang_cmake_builddir}/FlangTargets.cmake") +set(FLANG_CONFIG_INCLUDE_DIRS + "${FLANG_SOURCE_DIR}/include" + "${FLANG_BINARY_DIR}/include" + ) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfig.cmake.in + ${flang_cmake_builddir}/FlangConfig.cmake + @ONLY) +set(FLANG_CONFIG_CMAKE_DIR) +set(FLANG_CONFIG_LLVM_CMAKE_DIR) +set(FLANG_CONFIG_EXPORTS_FILE) + +# Generate FlangConfig.cmake for the install tree. +set(FLANG_CONFIG_CODE " + # Compute the installation prefix from this LLVMConfig.cmake file location. + get_filename_component(FLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") +# Construct the proper number of get_filename_component(... PATH) +# calls to compute the installation prefix. +string(REGEX REPLACE "/" ";" _count "${FLANG_INSTALL_PACKAGE_DIR}") +foreach(p ${_count}) + set(FLANG_CONFIG_CODE "${FLANG_CONFIG_CODE} + get_filename_component(FLANG_INSTALL_PREFIX \"\${FLANG_INSTALL_PREFIX}\" PATH)") +endforeach(p) + +set(FLANG_CONFIG_CMAKE_DIR "\${FLANG_INSTALL_PREFIX}/${FLANG_INSTALL_PACKAGE_DIR}") +set(FLANG_CONFIG_LLVM_CMAKE_DIR "\${FLANG_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") +set(FLANG_CONFIG_EXPORTS_FILE "\${FLANG_CMAKE_DIR}/FlangTargets.cmake") +set(FLANG_CONFIG_INCLUDE_DIRS "\${FLANG_INSTALL_PREFIX}/include") + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfig.cmake + @ONLY) + +set(FLANG_CONFIG_CODE) +set(FLANG_CONFIG_CMAKE_DIR) +set(FLANG_CONFIG_EXPORTS_FILE) + +if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + get_property(flang_has_exports GLOBAL PROPERTY FLANG_HAS_EXPORTS) + if(flang_has_exports) + install(EXPORT FlangTargets DESTINATION ${FLANG_INSTALL_PACKAGE_DIR} + COMPONENT flang-cmake-exports) + endif() + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfig.cmake + DESTINATION ${FLANG_INSTALL_PACKAGE_DIR} + COMPONENT flang-cmake-exports) + + if(NOT LLVM_ENABLE_IDE) + # Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS + add_custom_target(flang-cmake-exports) + add_llvm_install_targets(install-flang-cmake-exports + COMPONENT flang-cmake-exports) + endif() +endif() diff --git a/flang/cmake/modules/FlangConfig.cmake.in b/flang/cmake/modules/FlangConfig.cmake.in new file mode 100644 index 0000000..3540e2d --- /dev/null +++ b/flang/cmake/modules/FlangConfig.cmake.in @@ -0,0 +1,13 @@ +# This file allows users to call find_package(Flang) and pick up our targets. + +@FLANG_CONFIG_CODE@ + +find_package(LLVM REQUIRED CONFIG + HINTS "@FLANG_CONFIG_LLVM_CMAKE_DIR@") + +set(FLANG_EXPORTED_TARGETS "@FLANG_EXPORTS@") +set(FLANG_CMAKE_DIR "FLANG_CONFIG_CMAKE_DIR@") +set(FLANG_INCLUDE_DIRS "@FLANG_CONFIG_INCLUDE_DIRS@") + +# Provide all our library targets to users. +include("@FLANG_CONFIG_EXPORTS_FILE@") diff --git a/flang/include/CMakeLists.txt b/flang/include/CMakeLists.txt new file mode 100644 index 0000000..e6bb9db --- /dev/null +++ b/flang/include/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(flang) diff --git a/flang/include/flang/Version.inc.in b/flang/include/flang/Version.inc.in new file mode 100644 index 0000000..a0eeab2 --- /dev/null +++ b/flang/include/flang/Version.inc.in @@ -0,0 +1,5 @@ +#define FLANG_VERSION @FLANG_VERSION@ +#define FLANG_VERSION_STRING "@FLANG_VERSION@" +#define FLANG_VERSION_MAJOR @FLANG_VERSION_MAJOR@ +#define FLANG_VERSION_MINOR @FLANG_VERSION_MINOR@ +#define FLANG_VERSION_PATCHLEVEL @FLANG_VERSION_PATCHLEVEL@ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index f2fe30d..ae321b8 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -1,11 +1,3 @@ -#===-- lib/CMakeLists.txt --------------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - add_subdirectory(Common) add_subdirectory(Evaluate) add_subdirectory(Decimal) diff --git a/flang/lib/Common/CMakeLists.txt b/flang/lib/Common/CMakeLists.txt index acbe9d1..f1be58f 100644 --- a/flang/lib/Common/CMakeLists.txt +++ b/flang/lib/Common/CMakeLists.txt @@ -1,10 +1,3 @@ -#===-- lib/Common/CMakeLists.txt -------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# add_library(FortranCommon Fortran.cpp @@ -13,6 +6,8 @@ add_library(FortranCommon idioms.cpp ) +target_compile_features(FortranCommon PUBLIC cxx_std_17) + install (TARGETS FortranCommon ARCHIVE DESTINATION lib LIBRARY DESTINATION lib diff --git a/flang/lib/Decimal/CMakeLists.txt b/flang/lib/Decimal/CMakeLists.txt index 5454218..92f8762 100644 --- a/flang/lib/Decimal/CMakeLists.txt +++ b/flang/lib/Decimal/CMakeLists.txt @@ -1,16 +1,11 @@ -#===-- lib/Decimal/CMakeLists.txt ------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# add_library(FortranDecimal binary-to-decimal.cpp decimal-to-binary.cpp ) +target_compile_features(FortranDecimal PUBLIC cxx_std_17) + install (TARGETS FortranDecimal ARCHIVE DESTINATION lib LIBRARY DESTINATION lib diff --git a/flang/lib/Evaluate/CMakeLists.txt b/flang/lib/Evaluate/CMakeLists.txt index a3391dc..2b23455 100644 --- a/flang/lib/Evaluate/CMakeLists.txt +++ b/flang/lib/Evaluate/CMakeLists.txt @@ -1,10 +1,3 @@ -#===-- lib/Evaluate/CMakeLists.txt -----------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# add_library(FortranEvaluate call.cpp @@ -34,6 +27,8 @@ add_library(FortranEvaluate variable.cpp ) +target_compile_features(FortranEvaluate PUBLIC cxx_std_17) + target_link_libraries(FortranEvaluate FortranCommon FortranDecimal diff --git a/flang/lib/Parser/CMakeLists.txt b/flang/lib/Parser/CMakeLists.txt index a04f37c7..9dc6480 100644 --- a/flang/lib/Parser/CMakeLists.txt +++ b/flang/lib/Parser/CMakeLists.txt @@ -1,10 +1,3 @@ -#===-- lib/Parser/CMakeLists.txt -------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# add_library(FortranParser Fortran-parsers.cpp @@ -32,6 +25,8 @@ add_library(FortranParser user-state.cpp ) +target_compile_features(FortranParser PRIVATE cxx_std_17) + target_link_libraries(FortranParser FortranCommon LLVMSupport diff --git a/flang/lib/Semantics/CMakeLists.txt b/flang/lib/Semantics/CMakeLists.txt index cbe9fc9..1ca03d0 100644 --- a/flang/lib/Semantics/CMakeLists.txt +++ b/flang/lib/Semantics/CMakeLists.txt @@ -1,10 +1,3 @@ -#===-- lib/Semantics/CMakeLists.txt ----------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# add_library(FortranSemantics assignment.cpp @@ -43,6 +36,8 @@ add_library(FortranSemantics unparse-with-symbols.cpp ) +target_compile_features(FortranSemantics PUBLIC cxx_std_17) + target_link_libraries(FortranSemantics FortranCommon FortranEvaluate diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt index cdc5dd5..3e22d9f 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/test/CMakeLists.txt @@ -1,7 +1,9 @@ # Test runner infrastructure for Flang. This configures the Flang test trees # for use by Lit, and delegates to LLVM's lit test handlers. -set(FLANG_INTRINSIC_MODULES_DIR ${FLANG_BINARY_DIR}/tools/f18/include) +set(FLANG_INTRINSIC_MODULES_DIR ${FLANG_BINARY_DIR}/include/flang) + +set(FLANG_TOOLS_DIR ${FLANG_BINARY_DIR}/bin) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in @@ -10,6 +12,8 @@ configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py ) +add_subdirectory(Semantics) + set(FLANG_TEST_PARAMS flang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) @@ -21,10 +25,16 @@ if (LINK_WITH_FIR) list(APPEND FLANG_TEST_DEPENDS tco) endif() -add_lit_testsuite(check-all "Running the Flang regression tests" +add_custom_target(flang-test-depends DEPENDS ${FLANG_TEST_DEPENDS}) + +add_lit_testsuite(check-flang "Running the Flang regression tests" ${CMAKE_CURRENT_BINARY_DIR} PARAMS ${FLANG_TEST_PARAMS} DEPENDS ${FLANG_TEST_DEPENDS} ) -set_target_properties(check-all PROPERTIES FOLDER "Tests") +set_target_properties(check-flang PROPERTIES FOLDER "Tests") + +add_lit_testsuites(FLANG ${CMAKE_CURRENT_SOURCE_DIR} + PARAMS ${FLANG_TEST_PARAMS} + DEPENDS ${FLANG_TEST_DEPENDS}) diff --git a/flang/test/Semantics/CMakeLists.txt b/flang/test/Semantics/CMakeLists.txt new file mode 100644 index 0000000..bdc81bb --- /dev/null +++ b/flang/test/Semantics/CMakeLists.txt @@ -0,0 +1 @@ +configure_file(test_errors.sh.in ${FLANG_BINARY_DIR}/test/Semantics/test_errors.sh @ONLY) diff --git a/flang/test/Semantics/allocate01.f90 b/flang/test/Semantics/allocate01.f90 index 0948230..4907a9d 100644 --- a/flang/test/Semantics/allocate01.f90 +++ b/flang/test/Semantics/allocate01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements ! Creating a symbol that allocate should accept diff --git a/flang/test/Semantics/allocate02.f90 b/flang/test/Semantics/allocate02.f90 index 13a68e8..16895ef 100644 --- a/flang/test/Semantics/allocate02.f90 +++ b/flang/test/Semantics/allocate02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements diff --git a/flang/test/Semantics/allocate03.f90 b/flang/test/Semantics/allocate03.f90 index 63598f0..21b093d 100644 --- a/flang/test/Semantics/allocate03.f90 +++ b/flang/test/Semantics/allocate03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements subroutine C933_a(b1, ca3, ca4, cp3, cp3mold, cp4, cp7, cp8, bsrc) diff --git a/flang/test/Semantics/allocate04.f90 b/flang/test/Semantics/allocate04.f90 index 40e7562..9371fcb2 100644 --- a/flang/test/Semantics/allocate04.f90 +++ b/flang/test/Semantics/allocate04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements diff --git a/flang/test/Semantics/allocate05.f90 b/flang/test/Semantics/allocate05.f90 index 84814b6..e69ed9e 100644 --- a/flang/test/Semantics/allocate05.f90 +++ b/flang/test/Semantics/allocate05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements diff --git a/flang/test/Semantics/allocate06.f90 b/flang/test/Semantics/allocate06.f90 index 1de258c..ae9f4f6 100644 --- a/flang/test/Semantics/allocate06.f90 +++ b/flang/test/Semantics/allocate06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements diff --git a/flang/test/Semantics/allocate07.f90 b/flang/test/Semantics/allocate07.f90 index 14077a24..5f261f3 100644 --- a/flang/test/Semantics/allocate07.f90 +++ b/flang/test/Semantics/allocate07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements subroutine C936(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred) diff --git a/flang/test/Semantics/allocate08.f90 b/flang/test/Semantics/allocate08.f90 index 3e235fc..7733b3a 100644 --- a/flang/test/Semantics/allocate08.f90 +++ b/flang/test/Semantics/allocate08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements subroutine C945_a(srca, srcb, srcc, src_complex, src_logical, & diff --git a/flang/test/Semantics/allocate09.f90 b/flang/test/Semantics/allocate09.f90 index 61046fb..6e20521 100644 --- a/flang/test/Semantics/allocate09.f90 +++ b/flang/test/Semantics/allocate09.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements subroutine C946(param_ca_4_assumed, param_ta_4_assumed, param_ca_4_deferred) diff --git a/flang/test/Semantics/allocate10.f90 b/flang/test/Semantics/allocate10.f90 index c15dc57..2746f8e 100644 --- a/flang/test/Semantics/allocate10.f90 +++ b/flang/test/Semantics/allocate10.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements !TODO: mixing expr and source-expr? diff --git a/flang/test/Semantics/allocate11.f90 b/flang/test/Semantics/allocate11.f90 index b883edc..594bd1d 100644 --- a/flang/test/Semantics/allocate11.f90 +++ b/flang/test/Semantics/allocate11.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements ! TODO: Function Pointer in allocate and derived types! diff --git a/flang/test/Semantics/allocate12.f90 b/flang/test/Semantics/allocate12.f90 index 41de8ed..52fabf8 100644 --- a/flang/test/Semantics/allocate12.f90 +++ b/flang/test/Semantics/allocate12.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements subroutine C941_C942b_C950(xsrc, x1, a2, b2, cx1, ca2, cb1, cb2, c1) diff --git a/flang/test/Semantics/allocate13.f90 b/flang/test/Semantics/allocate13.f90 index b7010f5..99812f9 100644 --- a/flang/test/Semantics/allocate13.f90 +++ b/flang/test/Semantics/allocate13.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in ALLOCATE statements module not_iso_fortran_env diff --git a/flang/test/Semantics/altreturn01.f90 b/flang/test/Semantics/altreturn01.f90 index 0449ff7..b35d079 100644 --- a/flang/test/Semantics/altreturn01.f90 +++ b/flang/test/Semantics/altreturn01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check calls with alt returns CALL TEST (N, *100, *200 ) diff --git a/flang/test/Semantics/altreturn02.f90 b/flang/test/Semantics/altreturn02.f90 index 74ff969..a09df81 100644 --- a/flang/test/Semantics/altreturn02.f90 +++ b/flang/test/Semantics/altreturn02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check subroutine with alt return SUBROUTINE TEST (N, *, *) diff --git a/flang/test/Semantics/altreturn03.f90 b/flang/test/Semantics/altreturn03.f90 index 73a6386..15c5ce6 100644 --- a/flang/test/Semantics/altreturn03.f90 +++ b/flang/test/Semantics/altreturn03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for various alt return error conditions SUBROUTINE TEST (N, *, *) diff --git a/flang/test/Semantics/altreturn04.f90 b/flang/test/Semantics/altreturn04.f90 index e3714fb..4a9cf5b 100644 --- a/flang/test/Semantics/altreturn04.f90 +++ b/flang/test/Semantics/altreturn04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Functions cannot use alt return REAL FUNCTION altreturn01(X) diff --git a/flang/test/Semantics/altreturn05.f90 b/flang/test/Semantics/altreturn05.f90 index cbd222c..baa8bcf 100644 --- a/flang/test/Semantics/altreturn05.f90 +++ b/flang/test/Semantics/altreturn05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test extension: RETURN from main program return !ok diff --git a/flang/test/Semantics/assign01.f90 b/flang/test/Semantics/assign01.f90 index bd41a5b..e8ec067 100644 --- a/flang/test/Semantics/assign01.f90 +++ b/flang/test/Semantics/assign01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! 10.2.3.1(2) All masks and LHS of assignments in a WHERE must conform subroutine s1 diff --git a/flang/test/Semantics/assign02.f90 b/flang/test/Semantics/assign02.f90 index e97be64..c504f7a 100644 --- a/flang/test/Semantics/assign02.f90 +++ b/flang/test/Semantics/assign02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Pointer assignment constraints 10.2.2.2 module m1 diff --git a/flang/test/Semantics/assign03.f90 b/flang/test/Semantics/assign03.f90 index 5b9fe269..6274964 100644 --- a/flang/test/Semantics/assign03.f90 +++ b/flang/test/Semantics/assign03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Pointer assignment constraints 10.2.2.2 (see also assign02.f90) module m diff --git a/flang/test/Semantics/assign04.f90 b/flang/test/Semantics/assign04.f90 index dd0159bdd..c12857c 100644 --- a/flang/test/Semantics/assign04.f90 +++ b/flang/test/Semantics/assign04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! 9.4.5 subroutine s1 type :: t(k, l) diff --git a/flang/test/Semantics/bad-forward-type.f90 b/flang/test/Semantics/bad-forward-type.f90 index 62ad9d4..0c6de01 100644 --- a/flang/test/Semantics/bad-forward-type.f90 +++ b/flang/test/Semantics/bad-forward-type.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Forward references to derived types (error cases) !ERROR: The derived type 'undef' was forward-referenced but not defined diff --git a/flang/test/Semantics/bindings01.f90 b/flang/test/Semantics/bindings01.f90 index 54aaacd..4c517ad 100644 --- a/flang/test/Semantics/bindings01.f90 +++ b/flang/test/Semantics/bindings01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Confirm enforcement of constraints and restrictions in 7.5.7.3 ! and C779-C785. diff --git a/flang/test/Semantics/block-data01.f90 b/flang/test/Semantics/block-data01.f90 index 1647091..d9c6dcd 100644 --- a/flang/test/Semantics/block-data01.f90 +++ b/flang/test/Semantics/block-data01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test BLOCK DATA subprogram (14.3) block data foo !ERROR: IMPORT is not allowed in a BLOCK DATA subprogram diff --git a/flang/test/Semantics/blockconstruct01.f90 b/flang/test/Semantics/blockconstruct01.f90 index 7f7eec5..86c4ff1 100644 --- a/flang/test/Semantics/blockconstruct01.f90 +++ b/flang/test/Semantics/blockconstruct01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1107 -- COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, VALUE or ! STATEMENT FUNCTIONS not allow in specification part diff --git a/flang/test/Semantics/blockconstruct02.f90 b/flang/test/Semantics/blockconstruct02.f90 index 2a1a95f..77ce3c1 100644 --- a/flang/test/Semantics/blockconstruct02.f90 +++ b/flang/test/Semantics/blockconstruct02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1108 -- Save statement in a BLOCK construct shall not conatin a ! saved-entity-list that does not specify a common-block-name diff --git a/flang/test/Semantics/blockconstruct03.f90 b/flang/test/Semantics/blockconstruct03.f90 index df5aff7..3f1974d 100644 --- a/flang/test/Semantics/blockconstruct03.f90 +++ b/flang/test/Semantics/blockconstruct03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests implemented for this standard: ! Block Construct ! C1109 diff --git a/flang/test/Semantics/c_f_pointer.f90 b/flang/test/Semantics/c_f_pointer.f90 index 1064461..ab1b479 100644 --- a/flang/test/Semantics/c_f_pointer.f90 +++ b/flang/test/Semantics/c_f_pointer.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Enforce 18.2.3.3 program test diff --git a/flang/test/Semantics/call01.f90 b/flang/test/Semantics/call01.f90 index 88274dd..ed77fb8 100644 --- a/flang/test/Semantics/call01.f90 +++ b/flang/test/Semantics/call01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Confirm enforcement of constraints and restrictions in 15.6.2.1 non_recursive function f01(n) result(res) diff --git a/flang/test/Semantics/call02.f90 b/flang/test/Semantics/call02.f90 index 5d9bdf1..e100a8f 100644 --- a/flang/test/Semantics/call02.f90 +++ b/flang/test/Semantics/call02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! 15.5.1 procedure reference constraints and restrictions subroutine s01(elem, subr) diff --git a/flang/test/Semantics/call03.f90 b/flang/test/Semantics/call03.f90 index 098106a..13aba93 100644 --- a/flang/test/Semantics/call03.f90 +++ b/flang/test/Semantics/call03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.4 constraints and restrictions for non-POINTER non-ALLOCATABLE ! dummy arguments. diff --git a/flang/test/Semantics/call04.f90 b/flang/test/Semantics/call04.f90 index 3064fee..120cd54 100644 --- a/flang/test/Semantics/call04.f90 +++ b/flang/test/Semantics/call04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 8.5.10 & 8.5.18 constraints on dummy argument declarations module m diff --git a/flang/test/Semantics/call05.f90 b/flang/test/Semantics/call05.f90 index 80f1874..a7cd6d9 100644 --- a/flang/test/Semantics/call05.f90 +++ b/flang/test/Semantics/call05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.5 constraints and restrictions for POINTER & ALLOCATABLE ! arguments when both sides of the call have the same attributes. diff --git a/flang/test/Semantics/call06.f90 b/flang/test/Semantics/call06.f90 index eb4bd37..77eb0c4 100644 --- a/flang/test/Semantics/call06.f90 +++ b/flang/test/Semantics/call06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.6 constraints and restrictions for ALLOCATABLE ! dummy arguments. diff --git a/flang/test/Semantics/call07.f90 b/flang/test/Semantics/call07.f90 index f596e36..af9be02 100644 --- a/flang/test/Semantics/call07.f90 +++ b/flang/test/Semantics/call07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.7 constraints and restrictions for POINTER dummy arguments. module m diff --git a/flang/test/Semantics/call08.f90 b/flang/test/Semantics/call08.f90 index 88ec7e3..ae4497f 100644 --- a/flang/test/Semantics/call08.f90 +++ b/flang/test/Semantics/call08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.8 coarray dummy arguments module m diff --git a/flang/test/Semantics/call09.f90 b/flang/test/Semantics/call09.f90 index 0222447..337932d 100644 --- a/flang/test/Semantics/call09.f90 +++ b/flang/test/Semantics/call09.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.5.2.9(2,3,5) dummy procedure requirements module m diff --git a/flang/test/Semantics/call10.f90 b/flang/test/Semantics/call10.f90 index 567d85d..74a0474 100644 --- a/flang/test/Semantics/call10.f90 +++ b/flang/test/Semantics/call10.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.7 (C1583-C1590, C1592-C1599) constraints and restrictions ! for pure procedures. ! (C1591 is tested in call11.f90; C1594 in call12.f90.) diff --git a/flang/test/Semantics/call11.f90 b/flang/test/Semantics/call11.f90 index b53b403..d7b5904 100644 --- a/flang/test/Semantics/call11.f90 +++ b/flang/test/Semantics/call11.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.7 C1591 & others: contexts requiring pure subprograms module m diff --git a/flang/test/Semantics/call12.f90 b/flang/test/Semantics/call12.f90 index 3ce0812..e25a2608 100644 --- a/flang/test/Semantics/call12.f90 +++ b/flang/test/Semantics/call12.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.7 C1594 - prohibited assignments in pure subprograms module used diff --git a/flang/test/Semantics/call13.f90 b/flang/test/Semantics/call13.f90 index 952a7d0..23ef745 100644 --- a/flang/test/Semantics/call13.f90 +++ b/flang/test/Semantics/call13.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 15.4.2.2 constraints and restrictions for calls to implicit ! interfaces diff --git a/flang/test/Semantics/call14.f90 b/flang/test/Semantics/call14.f90 index e25620b..b874e6b 100644 --- a/flang/test/Semantics/call14.f90 +++ b/flang/test/Semantics/call14.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test 8.5.18 constraints on the VALUE attribute module m diff --git a/flang/test/Semantics/call15.f90 b/flang/test/Semantics/call15.f90 index 08886e4..1f66467 100644 --- a/flang/test/Semantics/call15.f90 +++ b/flang/test/Semantics/call15.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C711 An assumed-type actual argument that corresponds to an assumed-rank ! dummy argument shall be assumed-shape or assumed-rank. subroutine s(arg1, arg2, arg3) diff --git a/flang/test/Semantics/canondo16.f90 b/flang/test/Semantics/canondo16.f90 index d5c5db4..8eebde2 100644 --- a/flang/test/Semantics/canondo16.f90 +++ b/flang/test/Semantics/canondo16.f90 @@ -1,11 +1,11 @@ -! RUN: %S/test_any.sh %s %flang %t +! RUN: %S/test_any.sh %s %f18 %t ! Error test -- DO loop uses obsolete loop termination statement ! See R1131 and C1133 ! By default, this is not an error and label do are rewritten to non-label do. ! A warning is generated with -Mstandard -! EXEC: ${F18} -funparse-with-symbols -Mstandard -I../../tools/f18/include %s 2>&1 | ${FileCheck} %s +! EXEC: ${F18} -funparse-with-symbols -Mstandard -I../../include/flang %s 2>&1 | ${FileCheck} %s ! CHECK: end do diff --git a/flang/test/Semantics/coarrays01.f90 b/flang/test/Semantics/coarrays01.f90 index 3e8e167..c96e76c 100644 --- a/flang/test/Semantics/coarrays01.f90 +++ b/flang/test/Semantics/coarrays01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test selector and team-value in CHANGE TEAM statement ! OK diff --git a/flang/test/Semantics/complex01.f90 b/flang/test/Semantics/complex01.f90 index c70f0de..060760f 100644 --- a/flang/test/Semantics/complex01.f90 +++ b/flang/test/Semantics/complex01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C718 Each named constant in a complex literal constant shall be of type ! integer or real. subroutine s() diff --git a/flang/test/Semantics/computed-goto01.f90 b/flang/test/Semantics/computed-goto01.f90 index 9f24996..ff38b72 100644 --- a/flang/test/Semantics/computed-goto01.f90 +++ b/flang/test/Semantics/computed-goto01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that a basic computed goto compiles INTEGER, DIMENSION (2) :: B diff --git a/flang/test/Semantics/computed-goto02.f90 b/flang/test/Semantics/computed-goto02.f90 index eea61a8..aaca63a 100644 --- a/flang/test/Semantics/computed-goto02.f90 +++ b/flang/test/Semantics/computed-goto02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that computed goto express must be a scalar integer expression ! TODO: PGI, for example, accepts a float & converts the value to int. diff --git a/flang/test/Semantics/critical01.f90 b/flang/test/Semantics/critical01.f90 index 5ca97ad..1fa2553 100644 --- a/flang/test/Semantics/critical01.f90 +++ b/flang/test/Semantics/critical01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !C1117 subroutine test1(a, i) diff --git a/flang/test/Semantics/critical02.f90 b/flang/test/Semantics/critical02.f90 index ba5e0f4..a339c46 100644 --- a/flang/test/Semantics/critical02.f90 +++ b/flang/test/Semantics/critical02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !C1118 subroutine test1 diff --git a/flang/test/Semantics/critical03.f90 b/flang/test/Semantics/critical03.f90 index 2ab60e5..2964a3b 100644 --- a/flang/test/Semantics/critical03.f90 +++ b/flang/test/Semantics/critical03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !C1119 subroutine test1(a, i) diff --git a/flang/test/Semantics/data01.f90 b/flang/test/Semantics/data01.f90 index 4bdf7ea..1c86089 100644 --- a/flang/test/Semantics/data01.f90 +++ b/flang/test/Semantics/data01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !Test for checking data constraints, C882-C887 module m1 type person diff --git a/flang/test/Semantics/data02.f90 b/flang/test/Semantics/data02.f90 index ac69026..361f3a2 100644 --- a/flang/test/Semantics/data02.f90 +++ b/flang/test/Semantics/data02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that expressions are analyzed in data statements subroutine s1 diff --git a/flang/test/Semantics/deallocate01.f90 b/flang/test/Semantics/deallocate01.f90 index 8aaf144..9aa69e7 100644 --- a/flang/test/Semantics/deallocate01.f90 +++ b/flang/test/Semantics/deallocate01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test that DEALLOCATE works INTEGER, PARAMETER :: maxvalue=1024 diff --git a/flang/test/Semantics/deallocate04.f90 b/flang/test/Semantics/deallocate04.f90 index 2a1ad62..ce9acf9 100644 --- a/flang/test/Semantics/deallocate04.f90 +++ b/flang/test/Semantics/deallocate04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for type errors in DEALLOCATE statements INTEGER, PARAMETER :: maxvalue=1024 diff --git a/flang/test/Semantics/deallocate05.f90 b/flang/test/Semantics/deallocate05.f90 index fdc6600..862d885 100644 --- a/flang/test/Semantics/deallocate05.f90 +++ b/flang/test/Semantics/deallocate05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in DEALLOCATE statements Module share diff --git a/flang/test/Semantics/doconcurrent01.f90 b/flang/test/Semantics/doconcurrent01.f90 index a4161a5..7a3f9c0 100644 --- a/flang/test/Semantics/doconcurrent01.f90 +++ b/flang/test/Semantics/doconcurrent01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1141 ! A reference to the procedure IEEE_SET_HALTING_MODE ! from the intrinsic ! module IEEE_EXCEPTIONS, shall not ! appear within a DO CONCURRENT construct. diff --git a/flang/test/Semantics/doconcurrent05.f90 b/flang/test/Semantics/doconcurrent05.f90 index d92ef6d..df548f2 100644 --- a/flang/test/Semantics/doconcurrent05.f90 +++ b/flang/test/Semantics/doconcurrent05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if ! it belongs to that construct or an outer construct. diff --git a/flang/test/Semantics/doconcurrent06.f90 b/flang/test/Semantics/doconcurrent06.f90 index f178b7a..e20a830 100644 --- a/flang/test/Semantics/doconcurrent06.f90 +++ b/flang/test/Semantics/doconcurrent06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if ! it belongs to that construct or an outer construct. diff --git a/flang/test/Semantics/doconcurrent08.f90 b/flang/test/Semantics/doconcurrent08.f90 index 91a077f..826bc84 100644 --- a/flang/test/Semantics/doconcurrent08.f90 +++ b/flang/test/Semantics/doconcurrent08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1140 -- A statement that might result in the deallocation of a polymorphic ! entity shall not appear within a DO CONCURRENT construct. module m1 diff --git a/flang/test/Semantics/dosemantics01.f90 b/flang/test/Semantics/dosemantics01.f90 index 2261f18..55eae45 100644 --- a/flang/test/Semantics/dosemantics01.f90 +++ b/flang/test/Semantics/dosemantics01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1131 -- check valid and invalid DO loop naming PROGRAM C1131 diff --git a/flang/test/Semantics/dosemantics02.f90 b/flang/test/Semantics/dosemantics02.f90 index 96047f0..c40d3b8 100644 --- a/flang/test/Semantics/dosemantics02.f90 +++ b/flang/test/Semantics/dosemantics02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1121 -- any procedure referenced in a concurrent header must be pure ! Also, check that the step expressions are not zero. This is prohibited by diff --git a/flang/test/Semantics/dosemantics03.f90 b/flang/test/Semantics/dosemantics03.f90 index c063a7b..f82a7e4 100644 --- a/flang/test/Semantics/dosemantics03.f90 +++ b/flang/test/Semantics/dosemantics03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Issue 458 -- semantic checks for a normal DO loop. The DO variable ! and the initial, final, and step expressions must be INTEGER if the ! options for standard conformance and turning warnings into errors diff --git a/flang/test/Semantics/dosemantics04.f90 b/flang/test/Semantics/dosemantics04.f90 index 35a3c94..80bccf5 100644 --- a/flang/test/Semantics/dosemantics04.f90 +++ b/flang/test/Semantics/dosemantics04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1123 -- Expressions in DO CONCURRENT header cannot reference variables ! declared in the same header PROGRAM dosemantics04 diff --git a/flang/test/Semantics/dosemantics05.f90 b/flang/test/Semantics/dosemantics05.f90 index f565f9b..4e66049 100644 --- a/flang/test/Semantics/dosemantics05.f90 +++ b/flang/test/Semantics/dosemantics05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test DO loop semantics for constraint C1130 -- ! The constraint states that "If the locality-spec DEFAULT ( NONE ) appears in a ! DO CONCURRENT statement; a variable that is a local or construct entity of a diff --git a/flang/test/Semantics/dosemantics06.f90 b/flang/test/Semantics/dosemantics06.f90 index 41b9598..445eadc 100644 --- a/flang/test/Semantics/dosemantics06.f90 +++ b/flang/test/Semantics/dosemantics06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1131, C1133 -- check valid and invalid DO loop naming ! C1131 (R1119) If the do-stmt of a do-construct specifies a do-construct-name, ! the corresponding end-do shall be an end-do-stmt specifying the same diff --git a/flang/test/Semantics/dosemantics07.f90 b/flang/test/Semantics/dosemantics07.f90 index f1450dd..9558407 100644 --- a/flang/test/Semantics/dosemantics07.f90 +++ b/flang/test/Semantics/dosemantics07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !C1132 ! If the do-stmt is a nonlabel-do-stmt, the corresponding end-do shall be an ! end-do-stmt. diff --git a/flang/test/Semantics/dosemantics08.f90 b/flang/test/Semantics/dosemantics08.f90 index 388fb75..431443a 100644 --- a/flang/test/Semantics/dosemantics08.f90 +++ b/flang/test/Semantics/dosemantics08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1138 -- ! A branch (11.2) within a DO CONCURRENT construct shall not have a branch ! target that is outside the construct. diff --git a/flang/test/Semantics/dosemantics09.f90 b/flang/test/Semantics/dosemantics09.f90 index 46136f2..3d53e39 100644 --- a/flang/test/Semantics/dosemantics09.f90 +++ b/flang/test/Semantics/dosemantics09.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !C1129 !A variable that is referenced by the scalar-mask-expr of a !concurrent-header or by any concurrent-limit or concurrent-step in that diff --git a/flang/test/Semantics/dosemantics10.f90 b/flang/test/Semantics/dosemantics10.f90 index 561f9b7..3d81318 100644 --- a/flang/test/Semantics/dosemantics10.f90 +++ b/flang/test/Semantics/dosemantics10.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1134 A CYCLE statement must be within a DO construct ! ! C1166 An EXIT statement must be within a DO construct diff --git a/flang/test/Semantics/dosemantics11.f90 b/flang/test/Semantics/dosemantics11.f90 index 760f9f5..226f007 100644 --- a/flang/test/Semantics/dosemantics11.f90 +++ b/flang/test/Semantics/dosemantics11.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1135 A cycle-stmt shall not appear within a CHANGE TEAM, CRITICAL, or DO ! CONCURRENT construct if it belongs to an outer construct. ! diff --git a/flang/test/Semantics/dosemantics12.f90 b/flang/test/Semantics/dosemantics12.f90 index 48ecd14..4cd406e 100644 --- a/flang/test/Semantics/dosemantics12.f90 +++ b/flang/test/Semantics/dosemantics12.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. ! ! Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/flang/test/Semantics/entry01.f90 b/flang/test/Semantics/entry01.f90 index ccb03a7..f458ef51 100644 --- a/flang/test/Semantics/entry01.f90 +++ b/flang/test/Semantics/entry01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests valid and invalid ENTRY statements module m1 diff --git a/flang/test/Semantics/equivalence01.f90 b/flang/test/Semantics/equivalence01.f90 index 31b561e..68b2cd4 100644 --- a/flang/test/Semantics/equivalence01.f90 +++ b/flang/test/Semantics/equivalence01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 integer i, j real r(2) diff --git a/flang/test/Semantics/expr-errors01.f90 b/flang/test/Semantics/expr-errors01.f90 index a479e86..3606455 100644 --- a/flang/test/Semantics/expr-errors01.f90 +++ b/flang/test/Semantics/expr-errors01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1003 - can't parenthesize function call returning procedure pointer module m1 type :: dt diff --git a/flang/test/Semantics/expr-errors02.f90 b/flang/test/Semantics/expr-errors02.f90 index 4b0d6d4..af51e1c 100644 --- a/flang/test/Semantics/expr-errors02.f90 +++ b/flang/test/Semantics/expr-errors02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test specification expressions module m diff --git a/flang/test/Semantics/forall01.f90 b/flang/test/Semantics/forall01.f90 index ecb243b..f465237 100644 --- a/flang/test/Semantics/forall01.f90 +++ b/flang/test/Semantics/forall01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine forall1 real :: a(9) !ERROR: 'i' is already declared in this scoping unit diff --git a/flang/test/Semantics/if_arith01.f90 b/flang/test/Semantics/if_arith01.f90 index 5ec06b4..16e616f 100644 --- a/flang/test/Semantics/if_arith01.f90 +++ b/flang/test/Semantics/if_arith01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that a basic arithmetic if compiles. if ( A ) 100, 200, 300 diff --git a/flang/test/Semantics/if_arith02.f90 b/flang/test/Semantics/if_arith02.f90 index f8e24b4..4dfe72d 100644 --- a/flang/test/Semantics/if_arith02.f90 +++ b/flang/test/Semantics/if_arith02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that only labels are allowed in arithmetic if statements. ! TODO: Revisit error message "expected 'ASSIGN'" etc. ! TODO: Revisit error message "expected one of '0123456789'" diff --git a/flang/test/Semantics/if_arith03.f90 b/flang/test/Semantics/if_arith03.f90 index 1e5eb67..45ceec4 100644 --- a/flang/test/Semantics/if_arith03.f90 +++ b/flang/test/Semantics/if_arith03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !ERROR: label '600' was not found diff --git a/flang/test/Semantics/if_arith04.f90 b/flang/test/Semantics/if_arith04.f90 index 9a436cd..d947b0b 100644 --- a/flang/test/Semantics/if_arith04.f90 +++ b/flang/test/Semantics/if_arith04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Make sure arithmetic if expressions are non-complex numeric exprs. INTEGER I diff --git a/flang/test/Semantics/if_construct01.f90 b/flang/test/Semantics/if_construct01.f90 index c133b7d..adac3c2 100644 --- a/flang/test/Semantics/if_construct01.f90 +++ b/flang/test/Semantics/if_construct01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Simple check that if constructs are ok. if (a < b) then diff --git a/flang/test/Semantics/if_construct02.f90 b/flang/test/Semantics/if_construct02.f90 index 9ba6caa..de942864 100644 --- a/flang/test/Semantics/if_construct02.f90 +++ b/flang/test/Semantics/if_construct02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that if constructs only accept scalar logical expressions. ! TODO: expand the test to check this restriction for more types. diff --git a/flang/test/Semantics/if_stmt01.f90 b/flang/test/Semantics/if_stmt01.f90 index 51454a9..337d519 100644 --- a/flang/test/Semantics/if_stmt01.f90 +++ b/flang/test/Semantics/if_stmt01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Simple check that if statements are ok. IF (A > 0.0) A = LOG (A) diff --git a/flang/test/Semantics/if_stmt02.f90 b/flang/test/Semantics/if_stmt02.f90 index 71c4583..5672811 100644 --- a/flang/test/Semantics/if_stmt02.f90 +++ b/flang/test/Semantics/if_stmt02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !ERROR: IF statement is not allowed in IF statement IF (A > 0.0) IF (B < 0.0) A = LOG (A) END diff --git a/flang/test/Semantics/if_stmt03.f90 b/flang/test/Semantics/if_stmt03.f90 index 2a25954..970b70e 100644 --- a/flang/test/Semantics/if_stmt03.f90 +++ b/flang/test/Semantics/if_stmt03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check that non-logical expressions are not allowed. ! Check that non-scalar expressions are not allowed. ! TODO: Insure all non-logicals are prohibited. diff --git a/flang/test/Semantics/implicit01.f90 b/flang/test/Semantics/implicit01.f90 index f0893f7..5cc8709 100644 --- a/flang/test/Semantics/implicit01.f90 +++ b/flang/test/Semantics/implicit01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 implicit none !ERROR: More than one IMPLICIT NONE statement diff --git a/flang/test/Semantics/implicit02.f90 b/flang/test/Semantics/implicit02.f90 index 5d2b6e0..f301705 100644 --- a/flang/test/Semantics/implicit02.f90 +++ b/flang/test/Semantics/implicit02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 implicit none !ERROR: IMPLICIT statement after IMPLICIT NONE or IMPLICIT NONE(TYPE) statement diff --git a/flang/test/Semantics/implicit03.f90 b/flang/test/Semantics/implicit03.f90 index 9636743..bb6c495 100644 --- a/flang/test/Semantics/implicit03.f90 +++ b/flang/test/Semantics/implicit03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 implicit integer(a-z) !ERROR: IMPLICIT NONE statement after IMPLICIT statement diff --git a/flang/test/Semantics/implicit04.f90 b/flang/test/Semantics/implicit04.f90 index 86adb95..20de8c4 100644 --- a/flang/test/Semantics/implicit04.f90 +++ b/flang/test/Semantics/implicit04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s parameter(a=1.0) !ERROR: IMPLICIT NONE statement after PARAMETER statement diff --git a/flang/test/Semantics/implicit05.f90 b/flang/test/Semantics/implicit05.f90 index 7649c22..e6dec7d 100644 --- a/flang/test/Semantics/implicit05.f90 +++ b/flang/test/Semantics/implicit05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s !ERROR: 'a' does not follow 'b' alphabetically implicit integer(b-a) diff --git a/flang/test/Semantics/implicit06.f90 b/flang/test/Semantics/implicit06.f90 index 3f66720..9f54282 100644 --- a/flang/test/Semantics/implicit06.f90 +++ b/flang/test/Semantics/implicit06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 implicit integer(a-c) !ERROR: More than one implicit type specified for 'c' diff --git a/flang/test/Semantics/implicit07.f90 b/flang/test/Semantics/implicit07.f90 index 68fa37d..5ec6592 100644 --- a/flang/test/Semantics/implicit07.f90 +++ b/flang/test/Semantics/implicit07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t implicit none(external) external x call x diff --git a/flang/test/Semantics/implicit08.f90 b/flang/test/Semantics/implicit08.f90 index 44e96d8..a4a1c33 100644 --- a/flang/test/Semantics/implicit08.f90 +++ b/flang/test/Semantics/implicit08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 block !ERROR: IMPLICIT statement is not allowed in a BLOCK construct diff --git a/flang/test/Semantics/init01.f90 b/flang/test/Semantics/init01.f90 index 1fc1ed87..f848150 100644 --- a/flang/test/Semantics/init01.f90 +++ b/flang/test/Semantics/init01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Object pointer initializer error tests subroutine test(j) diff --git a/flang/test/Semantics/int-literals.f90 b/flang/test/Semantics/int-literals.f90 index 3c48b7e..01d31c5 100644 --- a/flang/test/Semantics/int-literals.f90 +++ b/flang/test/Semantics/int-literals.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Fortran syntax considers signed int literals in complex literals ! to be a distinct production, not an application of unary +/- to ! an unsigned int literal, so they're used here to test overflow diff --git a/flang/test/Semantics/io01.f90 b/flang/test/Semantics/io01.f90 index 81b537d..56936b6 100644 --- a/flang/test/Semantics/io01.f90 +++ b/flang/test/Semantics/io01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t character(len=20) :: access = "direcT" character(len=20) :: access_(2) = (/"direcT", "streaM"/) character(len=20) :: action_(2) = (/"reaD ", "writE"/) diff --git a/flang/test/Semantics/io02.f90 b/flang/test/Semantics/io02.f90 index 7cb901d..a405f3e 100644 --- a/flang/test/Semantics/io02.f90 +++ b/flang/test/Semantics/io02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t integer :: unit10 = 10 integer :: unit11 = 11 diff --git a/flang/test/Semantics/io03.f90 b/flang/test/Semantics/io03.f90 index a669617..6c91afc 100644 --- a/flang/test/Semantics/io03.f90 +++ b/flang/test/Semantics/io03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t character(kind=1,len=50) internal_file character(kind=2,len=50) internal_file2 character(kind=4,len=50) internal_file4 diff --git a/flang/test/Semantics/io04.f90 b/flang/test/Semantics/io04.f90 index 09776ef..5cda7ff 100644 --- a/flang/test/Semantics/io04.f90 +++ b/flang/test/Semantics/io04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t character(kind=1,len=50) internal_file character(kind=1,len=100) msg character(20) sign diff --git a/flang/test/Semantics/io05.f90 b/flang/test/Semantics/io05.f90 index 1df8781..8d10ab1 100644 --- a/flang/test/Semantics/io05.f90 +++ b/flang/test/Semantics/io05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t character*20 c(25), cv character(kind=1,len=59) msg logical*2 v(5), lv diff --git a/flang/test/Semantics/io06.f90 b/flang/test/Semantics/io06.f90 index eba437c..1b19fc6 100644 --- a/flang/test/Semantics/io06.f90 +++ b/flang/test/Semantics/io06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t character(kind=1,len=100) msg1 character(kind=2,len=200) msg2 integer(1) stat1 diff --git a/flang/test/Semantics/io07.f90 b/flang/test/Semantics/io07.f90 index 9462a099..e315468 100644 --- a/flang/test/Semantics/io07.f90 +++ b/flang/test/Semantics/io07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t 1001 format(A) !ERROR: Format statement must be labeled diff --git a/flang/test/Semantics/io08.f90 b/flang/test/Semantics/io08.f90 index 1b75e80..ca9638f 100644 --- a/flang/test/Semantics/io08.f90 +++ b/flang/test/Semantics/io08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t write(*,*) write(*,'()') write(*,'(A)') diff --git a/flang/test/Semantics/io09.f90 b/flang/test/Semantics/io09.f90 index 5f50e4e..7ce5e64 100644 --- a/flang/test/Semantics/io09.f90 +++ b/flang/test/Semantics/io09.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !ERROR: String edit descriptor in READ format expression read(*,'("abc")') diff --git a/flang/test/Semantics/io10.f90 b/flang/test/Semantics/io10.f90 index 90ae8b1..a302386 100644 --- a/flang/test/Semantics/io10.f90 +++ b/flang/test/Semantics/io10.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -Mstandard write(*, '(B0)') diff --git a/flang/test/Semantics/kinds02.f90 b/flang/test/Semantics/kinds02.f90 index f1ff0b2..bdc998b 100644 --- a/flang/test/Semantics/kinds02.f90 +++ b/flang/test/Semantics/kinds02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C712 The value of scalar-int-constant-expr shall be nonnegative and ! shall specify a representation method that exists on the processor. ! C714 The value of kind-param shall be nonnegative. diff --git a/flang/test/Semantics/kinds04.f90 b/flang/test/Semantics/kinds04.f90 index af6a896..54f953f 100644 --- a/flang/test/Semantics/kinds04.f90 +++ b/flang/test/Semantics/kinds04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C716 If both kind-param and exponent-letter appear, exponent-letter ! shall be E. ! C717 The value of kind-param shall specify an approximation method that diff --git a/flang/test/Semantics/misc-declarations.f90 b/flang/test/Semantics/misc-declarations.f90 index 9103ad7..7680eed 100644 --- a/flang/test/Semantics/misc-declarations.f90 +++ b/flang/test/Semantics/misc-declarations.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Miscellaneous constraint and requirement checking on declarations: ! - 8.5.6.2 & 8.5.6.3 constraints on coarrays ! - 8.5.19 constraints on the VOLATILE attribute diff --git a/flang/test/Semantics/namelist01.f90 b/flang/test/Semantics/namelist01.f90 index f659c99..b85357f 100644 --- a/flang/test/Semantics/namelist01.f90 +++ b/flang/test/Semantics/namelist01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test for checking namelist constraints, C8103-C8105 module dup diff --git a/flang/test/Semantics/null01.f90 b/flang/test/Semantics/null01.f90 index 09c6dce..478bedb 100644 --- a/flang/test/Semantics/null01.f90 +++ b/flang/test/Semantics/null01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! NULL() intrinsic function error tests subroutine test diff --git a/flang/test/Semantics/nullify01.f90 b/flang/test/Semantics/nullify01.f90 index 9af635f..62cde30 100644 --- a/flang/test/Semantics/nullify01.f90 +++ b/flang/test/Semantics/nullify01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test that NULLIFY works Module share diff --git a/flang/test/Semantics/nullify02.f90 b/flang/test/Semantics/nullify02.f90 index 49bcc9e..7a24083 100644 --- a/flang/test/Semantics/nullify02.f90 +++ b/flang/test/Semantics/nullify02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Check for semantic errors in NULLIFY statements INTEGER, PARAMETER :: maxvalue=1024 diff --git a/flang/test/Semantics/omp-atomic.f90 b/flang/test/Semantics/omp-atomic.f90 index 760d1ee..2a27bfa 100644 --- a/flang/test/Semantics/omp-atomic.f90 +++ b/flang/test/Semantics/omp-atomic.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check OpenMP 2.13.6 atomic Construct diff --git a/flang/test/Semantics/omp-clause-validity01.f90 b/flang/test/Semantics/omp-clause-validity01.f90 index 523b2ee..bcfea4c 100644 --- a/flang/test/Semantics/omp-clause-validity01.f90 +++ b/flang/test/Semantics/omp-clause-validity01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check OpenMP clause validity for the following directives: diff --git a/flang/test/Semantics/omp-declarative-directive.f90 b/flang/test/Semantics/omp-declarative-directive.f90 index 639ed7d..98787ee 100644 --- a/flang/test/Semantics/omp-declarative-directive.f90 +++ b/flang/test/Semantics/omp-declarative-directive.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check OpenMP declarative directives diff --git a/flang/test/Semantics/omp-device-constructs.f90 b/flang/test/Semantics/omp-device-constructs.f90 index 7973dc2..15daec3 100644 --- a/flang/test/Semantics/omp-device-constructs.f90 +++ b/flang/test/Semantics/omp-device-constructs.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check OpenMP clause validity for the following directives: ! 2.10 Device constructs diff --git a/flang/test/Semantics/omp-loop-association.f90 b/flang/test/Semantics/omp-loop-association.f90 index 22e9365..036d7c3 100644 --- a/flang/test/Semantics/omp-loop-association.f90 +++ b/flang/test/Semantics/omp-loop-association.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check the association between OpenMPLoopConstruct and DoConstruct diff --git a/flang/test/Semantics/omp-nested01.f90 b/flang/test/Semantics/omp-nested01.f90 index 1c0e84a..b13f536 100644 --- a/flang/test/Semantics/omp-nested01.f90 +++ b/flang/test/Semantics/omp-nested01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! OPTIONS: -fopenmp ! Check OpenMP 2.17 Nesting of Regions diff --git a/flang/test/Semantics/omp-resolve01.f90 b/flang/test/Semantics/omp-resolve01.f90 index 528915e..47479b4 100644 --- a/flang/test/Semantics/omp-resolve01.f90 +++ b/flang/test/Semantics/omp-resolve01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -fopenmp ! 2.4 An array section designates a subset of the elements in an array. Although diff --git a/flang/test/Semantics/omp-resolve02.f90 b/flang/test/Semantics/omp-resolve02.f90 index 3d34166..3f28973 100644 --- a/flang/test/Semantics/omp-resolve02.f90 +++ b/flang/test/Semantics/omp-resolve02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -fopenmp ! Test the effect to name resolution from illegal clause diff --git a/flang/test/Semantics/omp-resolve03.f90 b/flang/test/Semantics/omp-resolve03.f90 index a896ef3..8e20d23 100644 --- a/flang/test/Semantics/omp-resolve03.f90 +++ b/flang/test/Semantics/omp-resolve03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -fopenmp ! 2.15.3 Although variables in common blocks can be accessed by use association diff --git a/flang/test/Semantics/omp-resolve04.f90 b/flang/test/Semantics/omp-resolve04.f90 index 2340138..a216616 100644 --- a/flang/test/Semantics/omp-resolve04.f90 +++ b/flang/test/Semantics/omp-resolve04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -fopenmp ! 2.15.3 Data-Sharing Attribute Clauses diff --git a/flang/test/Semantics/omp-resolve05.f90 b/flang/test/Semantics/omp-resolve05.f90 index ebc5047..dc15b18 100644 --- a/flang/test/Semantics/omp-resolve05.f90 +++ b/flang/test/Semantics/omp-resolve05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -fopenmp ! 2.15.3 Data-Sharing Attribute Clauses diff --git a/flang/test/Semantics/resolve01.f90 b/flang/test/Semantics/resolve01.f90 index eee8d66..f64599e 100644 --- a/flang/test/Semantics/resolve01.f90 +++ b/flang/test/Semantics/resolve01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t integer :: x !ERROR: The type of 'x' has already been declared real :: x diff --git a/flang/test/Semantics/resolve02.f90 b/flang/test/Semantics/resolve02.f90 index 0d8e83b..9978a95 100644 --- a/flang/test/Semantics/resolve02.f90 +++ b/flang/test/Semantics/resolve02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s !ERROR: Declaration of 'x' conflicts with its use as internal procedure real :: x diff --git a/flang/test/Semantics/resolve03.f90 b/flang/test/Semantics/resolve03.f90 index 773aaab..825509d 100644 --- a/flang/test/Semantics/resolve03.f90 +++ b/flang/test/Semantics/resolve03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t implicit none integer :: x !ERROR: No explicit type declared for 'y' diff --git a/flang/test/Semantics/resolve04.f90 b/flang/test/Semantics/resolve04.f90 index 5132b9f..eeb6cb6 100644 --- a/flang/test/Semantics/resolve04.f90 +++ b/flang/test/Semantics/resolve04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !ERROR: No explicit type declared for 'f' function f() implicit none diff --git a/flang/test/Semantics/resolve05.f90 b/flang/test/Semantics/resolve05.f90 index d1960e1..89d501c 100644 --- a/flang/test/Semantics/resolve05.f90 +++ b/flang/test/Semantics/resolve05.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t program p integer :: p ! this is ok end diff --git a/flang/test/Semantics/resolve06.f90 b/flang/test/Semantics/resolve06.f90 index 276feb3..c0fd7a1 100644 --- a/flang/test/Semantics/resolve06.f90 +++ b/flang/test/Semantics/resolve06.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t implicit none allocatable :: x integer :: x diff --git a/flang/test/Semantics/resolve07.f90 b/flang/test/Semantics/resolve07.f90 index f2e46f4..08156c4 100644 --- a/flang/test/Semantics/resolve07.f90 +++ b/flang/test/Semantics/resolve07.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 integer :: x(2) !ERROR: The dimensions of 'x' have already been declared diff --git a/flang/test/Semantics/resolve08.f90 b/flang/test/Semantics/resolve08.f90 index 7252c79..db238a4 100644 --- a/flang/test/Semantics/resolve08.f90 +++ b/flang/test/Semantics/resolve08.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t integer :: g(10) f(i) = i + 1 ! statement function g(i) = i + 2 ! mis-parsed array assignment diff --git a/flang/test/Semantics/resolve09.f90 b/flang/test/Semantics/resolve09.f90 index 5104a37..cf919599 100644 --- a/flang/test/Semantics/resolve09.f90 +++ b/flang/test/Semantics/resolve09.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t integer :: y procedure() :: a procedure(real) :: b diff --git a/flang/test/Semantics/resolve10.f90 b/flang/test/Semantics/resolve10.f90 index 9990935..5506d39 100644 --- a/flang/test/Semantics/resolve10.f90 +++ b/flang/test/Semantics/resolve10.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m public type t diff --git a/flang/test/Semantics/resolve11.f90 b/flang/test/Semantics/resolve11.f90 index d94c0f8c..1ff6a63 100644 --- a/flang/test/Semantics/resolve11.f90 +++ b/flang/test/Semantics/resolve11.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m public i integer, private :: j diff --git a/flang/test/Semantics/resolve12.f90 b/flang/test/Semantics/resolve12.f90 index 03bad9f..b68e3b7 100644 --- a/flang/test/Semantics/resolve12.f90 +++ b/flang/test/Semantics/resolve12.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 end diff --git a/flang/test/Semantics/resolve13.f90 b/flang/test/Semantics/resolve13.f90 index 6fc03b1..5ee05db 100644 --- a/flang/test/Semantics/resolve13.f90 +++ b/flang/test/Semantics/resolve13.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 integer :: x integer, private :: y diff --git a/flang/test/Semantics/resolve14.f90 b/flang/test/Semantics/resolve14.f90 index 326fe8e..d24a5c6 100644 --- a/flang/test/Semantics/resolve14.f90 +++ b/flang/test/Semantics/resolve14.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 integer :: x integer :: y diff --git a/flang/test/Semantics/resolve15.f90 b/flang/test/Semantics/resolve15.f90 index 1cca8ce..d91713a 100644 --- a/flang/test/Semantics/resolve15.f90 +++ b/flang/test/Semantics/resolve15.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m real :: var interface i diff --git a/flang/test/Semantics/resolve16.f90 b/flang/test/Semantics/resolve16.f90 index 8ce084a..a9d0842 100644 --- a/flang/test/Semantics/resolve16.f90 +++ b/flang/test/Semantics/resolve16.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m interface subroutine sub0 diff --git a/flang/test/Semantics/resolve17.f90 b/flang/test/Semantics/resolve17.f90 index f9c9451..4d1afee 100644 --- a/flang/test/Semantics/resolve17.f90 +++ b/flang/test/Semantics/resolve17.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m integer :: foo !Note: PGI, Intel, and GNU allow this; NAG and Sun do not diff --git a/flang/test/Semantics/resolve18.f90 b/flang/test/Semantics/resolve18.f90 index dff395f..50246ea 100644 --- a/flang/test/Semantics/resolve18.f90 +++ b/flang/test/Semantics/resolve18.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 implicit none contains diff --git a/flang/test/Semantics/resolve19.f90 b/flang/test/Semantics/resolve19.f90 index f28f2b4..3234f4c 100644 --- a/flang/test/Semantics/resolve19.f90 +++ b/flang/test/Semantics/resolve19.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m interface a subroutine s(x) diff --git a/flang/test/Semantics/resolve20.f90 b/flang/test/Semantics/resolve20.f90 index 38dbd23..b38b8e3 100644 --- a/flang/test/Semantics/resolve20.f90 +++ b/flang/test/Semantics/resolve20.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m abstract interface subroutine foo diff --git a/flang/test/Semantics/resolve21.f90 b/flang/test/Semantics/resolve21.f90 index 764537a..dfd87b3 100644 --- a/flang/test/Semantics/resolve21.f90 +++ b/flang/test/Semantics/resolve21.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 type :: t integer :: i diff --git a/flang/test/Semantics/resolve22.f90 b/flang/test/Semantics/resolve22.f90 index 3549ec7..b9290cb 100644 --- a/flang/test/Semantics/resolve22.f90 +++ b/flang/test/Semantics/resolve22.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 !OK: interface followed by type with same name interface t diff --git a/flang/test/Semantics/resolve23.f90 b/flang/test/Semantics/resolve23.f90 index 4164484..ffd408f 100644 --- a/flang/test/Semantics/resolve23.f90 +++ b/flang/test/Semantics/resolve23.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m type :: t real :: y diff --git a/flang/test/Semantics/resolve24.f90 b/flang/test/Semantics/resolve24.f90 index c2ce595..5b4a1ad 100644 --- a/flang/test/Semantics/resolve24.f90 +++ b/flang/test/Semantics/resolve24.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine test1 !ERROR: Generic interface 'foo' has both a function and a subroutine interface foo diff --git a/flang/test/Semantics/resolve25.f90 b/flang/test/Semantics/resolve25.f90 index 4d3ec8c..780c075 100644 --- a/flang/test/Semantics/resolve25.f90 +++ b/flang/test/Semantics/resolve25.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m interface foo subroutine s1(x) diff --git a/flang/test/Semantics/resolve26.f90 b/flang/test/Semantics/resolve26.f90 index f39366fa..65cfccf 100644 --- a/flang/test/Semantics/resolve26.f90 +++ b/flang/test/Semantics/resolve26.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 interface module subroutine s() diff --git a/flang/test/Semantics/resolve27.f90 b/flang/test/Semantics/resolve27.f90 index b10105e..c8e3d82 100644 --- a/flang/test/Semantics/resolve27.f90 +++ b/flang/test/Semantics/resolve27.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m interface module subroutine s() diff --git a/flang/test/Semantics/resolve28.f90 b/flang/test/Semantics/resolve28.f90 index 0fd8180..17e6032 100644 --- a/flang/test/Semantics/resolve28.f90 +++ b/flang/test/Semantics/resolve28.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s type t end type diff --git a/flang/test/Semantics/resolve29.f90 b/flang/test/Semantics/resolve29.f90 index d328eba..7dcd616 100644 --- a/flang/test/Semantics/resolve29.f90 +++ b/flang/test/Semantics/resolve29.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m type t1 end type diff --git a/flang/test/Semantics/resolve30.f90 b/flang/test/Semantics/resolve30.f90 index 9877712..c3abaf5 100644 --- a/flang/test/Semantics/resolve30.f90 +++ b/flang/test/Semantics/resolve30.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 integer x block diff --git a/flang/test/Semantics/resolve31.f90 b/flang/test/Semantics/resolve31.f90 index 3c61cd0..a1fb7ce 100644 --- a/flang/test/Semantics/resolve31.f90 +++ b/flang/test/Semantics/resolve31.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 integer :: t0 !ERROR: 't0' is not a derived type diff --git a/flang/test/Semantics/resolve32.f90 b/flang/test/Semantics/resolve32.f90 index 317a0ad..1b0140e 100644 --- a/flang/test/Semantics/resolve32.f90 +++ b/flang/test/Semantics/resolve32.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m2 public s2, s4 private s3 diff --git a/flang/test/Semantics/resolve33.f90 b/flang/test/Semantics/resolve33.f90 index 4a37c5f..d4265cd 100644 --- a/flang/test/Semantics/resolve33.f90 +++ b/flang/test/Semantics/resolve33.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Derived type parameters module m diff --git a/flang/test/Semantics/resolve34.f90 b/flang/test/Semantics/resolve34.f90 index 9d148ff..39730ce 100644 --- a/flang/test/Semantics/resolve34.f90 +++ b/flang/test/Semantics/resolve34.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Extended derived types module m1 diff --git a/flang/test/Semantics/resolve35.f90 b/flang/test/Semantics/resolve35.f90 index 7f6a8ea..d78c1cb 100644 --- a/flang/test/Semantics/resolve35.f90 +++ b/flang/test/Semantics/resolve35.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Construct names subroutine s1 diff --git a/flang/test/Semantics/resolve36.f90 b/flang/test/Semantics/resolve36.f90 index 7ed9391..13f6a14 100644 --- a/flang/test/Semantics/resolve36.f90 +++ b/flang/test/Semantics/resolve36.f90 @@ -1,8 +1,7 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1568 The procedure-name shall have been declared to be a separate module ! procedure in the containing program unit or an ancestor of that program unit. - module m1 interface module subroutine sub1(arg1) diff --git a/flang/test/Semantics/resolve37.f90 b/flang/test/Semantics/resolve37.f90 index a07ebbc..c56ac371 100644 --- a/flang/test/Semantics/resolve37.f90 +++ b/flang/test/Semantics/resolve37.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C701 The type-param-value for a kind type parameter shall be a constant ! expression. This constraint looks like a mistake in the standard. integer, parameter :: k = 8 diff --git a/flang/test/Semantics/resolve38.f90 b/flang/test/Semantics/resolve38.f90 index 53e8db8..98ac17f 100644 --- a/flang/test/Semantics/resolve38.f90 +++ b/flang/test/Semantics/resolve38.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C772 module m1 type t1 diff --git a/flang/test/Semantics/resolve39.f90 b/flang/test/Semantics/resolve39.f90 index d0052f1..b34bbec 100644 --- a/flang/test/Semantics/resolve39.f90 +++ b/flang/test/Semantics/resolve39.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 implicit none real(8) :: x = 2.0 diff --git a/flang/test/Semantics/resolve40.f90 b/flang/test/Semantics/resolve40.f90 index 95c2c9e..b4d8aa0 100644 --- a/flang/test/Semantics/resolve40.f90 +++ b/flang/test/Semantics/resolve40.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 namelist /nl/x block diff --git a/flang/test/Semantics/resolve41.f90 b/flang/test/Semantics/resolve41.f90 index e2bf877..40522d8 100644 --- a/flang/test/Semantics/resolve41.f90 +++ b/flang/test/Semantics/resolve41.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m implicit none real, parameter :: a = 8.0 diff --git a/flang/test/Semantics/resolve42.f90 b/flang/test/Semantics/resolve42.f90 index 5b6ac9f..af5d6e5e 100644 --- a/flang/test/Semantics/resolve42.f90 +++ b/flang/test/Semantics/resolve42.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1 !ERROR: Array 'z' without ALLOCATABLE or POINTER attribute must have explicit shape common x, y(4), z(:) diff --git a/flang/test/Semantics/resolve43.f90 b/flang/test/Semantics/resolve43.f90 index 385dfed..2ef585a 100644 --- a/flang/test/Semantics/resolve43.f90 +++ b/flang/test/Semantics/resolve43.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for structure constructors. ! Errors caught by expression resolution are tested elsewhere; these are the ! errors meant to be caught by name resolution, as well as acceptable use diff --git a/flang/test/Semantics/resolve44.f90 b/flang/test/Semantics/resolve44.f90 index dd082ad..2d8b701 100644 --- a/flang/test/Semantics/resolve44.f90 +++ b/flang/test/Semantics/resolve44.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for recursive use of derived types. program main diff --git a/flang/test/Semantics/resolve45.f90 b/flang/test/Semantics/resolve45.f90 index e28dc33..bb5eaf4 100644 --- a/flang/test/Semantics/resolve45.f90 +++ b/flang/test/Semantics/resolve45.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t function f1(x, y) integer x !ERROR: SAVE attribute may not be applied to dummy argument 'x' diff --git a/flang/test/Semantics/resolve46.f90 b/flang/test/Semantics/resolve46.f90 index 181ccfb..da31741 100644 --- a/flang/test/Semantics/resolve46.f90 +++ b/flang/test/Semantics/resolve46.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C1030 - pointers to intrinsic procedures program main intrinsic :: cos ! a specific & generic intrinsic name diff --git a/flang/test/Semantics/resolve47.f90 b/flang/test/Semantics/resolve47.f90 index 04dab56..0f27ee4 100644 --- a/flang/test/Semantics/resolve47.f90 +++ b/flang/test/Semantics/resolve47.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m1 !ERROR: Logical constant '.true.' may not be used as a defined operator interface operator(.TRUE.) diff --git a/flang/test/Semantics/resolve48.f90 b/flang/test/Semantics/resolve48.f90 index 887505d..6651a72 100644 --- a/flang/test/Semantics/resolve48.f90 +++ b/flang/test/Semantics/resolve48.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test correct use-association of a derived type. module m1 implicit none diff --git a/flang/test/Semantics/resolve49.f90 b/flang/test/Semantics/resolve49.f90 index 97d2cbd..58339904 100644 --- a/flang/test/Semantics/resolve49.f90 +++ b/flang/test/Semantics/resolve49.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test section subscript program p1 real :: a(10,10) diff --git a/flang/test/Semantics/resolve50.f90 b/flang/test/Semantics/resolve50.f90 index 34d6f1c..8158ab6 100644 --- a/flang/test/Semantics/resolve50.f90 +++ b/flang/test/Semantics/resolve50.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test coarray association in CHANGE TEAM statement subroutine s1 diff --git a/flang/test/Semantics/resolve51.f90 b/flang/test/Semantics/resolve51.f90 index de763ef..d2942a8 100644 --- a/flang/test/Semantics/resolve51.f90 +++ b/flang/test/Semantics/resolve51.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test SELECT TYPE errors: C1157 subroutine s1() diff --git a/flang/test/Semantics/resolve52.f90 b/flang/test/Semantics/resolve52.f90 index 846b412..33eef54 100644 --- a/flang/test/Semantics/resolve52.f90 +++ b/flang/test/Semantics/resolve52.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests for C760: ! The passed-object dummy argument shall be a scalar, nonpointer, nonallocatable ! dummy data object with the same declared type as the type being defined; diff --git a/flang/test/Semantics/resolve53.f90 b/flang/test/Semantics/resolve53.f90 index 1aee5e7..e501941 100644 --- a/flang/test/Semantics/resolve53.f90 +++ b/flang/test/Semantics/resolve53.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! 15.4.3.4.5 Restrictions on generic declarations ! Specific procedures of generic interfaces must be distinguishable. diff --git a/flang/test/Semantics/resolve54.f90 b/flang/test/Semantics/resolve54.f90 index f9f895f..f8b80fc 100644 --- a/flang/test/Semantics/resolve54.f90 +++ b/flang/test/Semantics/resolve54.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests based on examples in C.10.6 ! C.10.6(10) diff --git a/flang/test/Semantics/resolve55.f90 b/flang/test/Semantics/resolve55.f90 index 98006bc..422168b 100644 --- a/flang/test/Semantics/resolve55.f90 +++ b/flang/test/Semantics/resolve55.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests for C1128: ! A variable-name that appears in a LOCAL or LOCAL_INIT locality-spec shall not ! have the ALLOCATABLE; INTENT (IN); or OPTIONAL attribute; shall not be of diff --git a/flang/test/Semantics/resolve56.f90 b/flang/test/Semantics/resolve56.f90 index 1efa535..ef99f99 100644 --- a/flang/test/Semantics/resolve56.f90 +++ b/flang/test/Semantics/resolve56.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test that associations constructs can be correctly combined. The intrinsic ! functions are not what is tested here, they are only use to reveal the types ! of local variables. diff --git a/flang/test/Semantics/resolve57.f90 b/flang/test/Semantics/resolve57.f90 index 265decd..50843a1 100644 --- a/flang/test/Semantics/resolve57.f90 +++ b/flang/test/Semantics/resolve57.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests for the last sentence of C1128: !A variable-name that is not permitted to appear in a variable definition !context shall not appear in a LOCAL or LOCAL_INIT locality-spec. diff --git a/flang/test/Semantics/resolve58.f90 b/flang/test/Semantics/resolve58.f90 index db11e67..15fe467 100644 --- a/flang/test/Semantics/resolve58.f90 +++ b/flang/test/Semantics/resolve58.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1(x, y) !ERROR: Array pointer 'x' must have deferred shape or assumed rank real, pointer :: x(1:) ! C832 diff --git a/flang/test/Semantics/resolve59.f90 b/flang/test/Semantics/resolve59.f90 index fdc4370..49e46a9 100644 --- a/flang/test/Semantics/resolve59.f90 +++ b/flang/test/Semantics/resolve59.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Testing 15.6.2.2 point 4 (What function-name refers to depending on the ! presence of RESULT). diff --git a/flang/test/Semantics/resolve60.f90 b/flang/test/Semantics/resolve60.f90 index 3232bc0..811460e 100644 --- a/flang/test/Semantics/resolve60.f90 +++ b/flang/test/Semantics/resolve60.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Testing 7.6 enum ! OK diff --git a/flang/test/Semantics/resolve61.f90 b/flang/test/Semantics/resolve61.f90 index eb5ba13..fe2840c 100644 --- a/flang/test/Semantics/resolve61.f90 +++ b/flang/test/Semantics/resolve61.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t program p1 integer(8) :: a, b, c, d pointer(a, b) diff --git a/flang/test/Semantics/resolve62.f90 b/flang/test/Semantics/resolve62.f90 index 5de3a45..1ce28f3 100644 --- a/flang/test/Semantics/resolve62.f90 +++ b/flang/test/Semantics/resolve62.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Resolve generic based on number of arguments subroutine s1 interface f diff --git a/flang/test/Semantics/resolve63.f90 b/flang/test/Semantics/resolve63.f90 index 07ae767..5909157 100644 --- a/flang/test/Semantics/resolve63.f90 +++ b/flang/test/Semantics/resolve63.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Invalid operand types when user-defined operator is available module m1 type :: t diff --git a/flang/test/Semantics/resolve64.f90 b/flang/test/Semantics/resolve64.f90 index 3be2ae1..b0c2a60 100644 --- a/flang/test/Semantics/resolve64.f90 +++ b/flang/test/Semantics/resolve64.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t !OPTIONS: -flogical-abbreviations -fxor-operator ! Like m4 in resolve63 but compiled with different options. diff --git a/flang/test/Semantics/resolve65.f90 b/flang/test/Semantics/resolve65.f90 index 9e1278b6..f43d70bb 100644 --- a/flang/test/Semantics/resolve65.f90 +++ b/flang/test/Semantics/resolve65.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test restrictions on what subprograms can be used for defined assignment. module m1 diff --git a/flang/test/Semantics/resolve66.f90 b/flang/test/Semantics/resolve66.f90 index d54fd2b..2f2e359 100644 --- a/flang/test/Semantics/resolve66.f90 +++ b/flang/test/Semantics/resolve66.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test that user-defined assignment is used in the right places module m1 diff --git a/flang/test/Semantics/resolve67.f90 b/flang/test/Semantics/resolve67.f90 index 7a8537a..883909e 100644 --- a/flang/test/Semantics/resolve67.f90 +++ b/flang/test/Semantics/resolve67.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test restrictions on what subprograms can be used for defined operators. ! See: 15.4.3.4.2 diff --git a/flang/test/Semantics/resolve68.f90 b/flang/test/Semantics/resolve68.f90 index 6accdaf..caa6f25 100644 --- a/flang/test/Semantics/resolve68.f90 +++ b/flang/test/Semantics/resolve68.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Test resolution of type-bound generics. module m1 diff --git a/flang/test/Semantics/resolve69.f90 b/flang/test/Semantics/resolve69.f90 index 3bbc37e..d5a35aa 100644 --- a/flang/test/Semantics/resolve69.f90 +++ b/flang/test/Semantics/resolve69.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t subroutine s1() ! C701 (R701) The type-param-value for a kind type parameter shall be a ! constant expression. diff --git a/flang/test/Semantics/resolve70.f90 b/flang/test/Semantics/resolve70.f90 index 31f33c3..8f805b6 100644 --- a/flang/test/Semantics/resolve70.f90 +++ b/flang/test/Semantics/resolve70.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C703 (R702) The derived-type-spec shall not specify an abstract type (7.5.7). ! This constraint refers to the derived-type-spec in a type-spec. A type-spec ! can appear in an ALLOCATE statement, an ac-spec for an array constructor, and diff --git a/flang/test/Semantics/resolve71.f90 b/flang/test/Semantics/resolve71.f90 index 8c1c56f..b4a232e 100644 --- a/flang/test/Semantics/resolve71.f90 +++ b/flang/test/Semantics/resolve71.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C708 An entity declared with the CLASS keyword shall be a dummy argument ! or have the ALLOCATABLE or POINTER attribute. subroutine s() diff --git a/flang/test/Semantics/resolve72.f90 b/flang/test/Semantics/resolve72.f90 index 284fb2f..0e7dfcb 100644 --- a/flang/test/Semantics/resolve72.f90 +++ b/flang/test/Semantics/resolve72.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C709 An assumed-type entity shall be a dummy data object that does not have ! the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE attribute and ! is not an explicit-shape array. diff --git a/flang/test/Semantics/resolve73.f90 b/flang/test/Semantics/resolve73.f90 index 35f8429..195f702 100644 --- a/flang/test/Semantics/resolve73.f90 +++ b/flang/test/Semantics/resolve73.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C721 A type-param-value of * shall be used only ! * to declare a dummy argument, ! * to declare a named constant, diff --git a/flang/test/Semantics/resolve74.f90 b/flang/test/Semantics/resolve74.f90 index 60927b1..79a1b2c 100644 --- a/flang/test/Semantics/resolve74.f90 +++ b/flang/test/Semantics/resolve74.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C722 A function name shall not be declared with an asterisk type-param-value ! unless it is of type CHARACTER and is the name of a dummy function or the ! name of the result of an external function. diff --git a/flang/test/Semantics/resolve75.f90 b/flang/test/Semantics/resolve75.f90 index 708ce8f..025159d 100644 --- a/flang/test/Semantics/resolve75.f90 +++ b/flang/test/Semantics/resolve75.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C726 The length specified for a character statement function or for a ! statement function dummy argument of type character shall be a constant ! expression. diff --git a/flang/test/Semantics/resolve76.f90 b/flang/test/Semantics/resolve76.f90 index e68c81f..e5e22a9 100644 --- a/flang/test/Semantics/resolve76.f90 +++ b/flang/test/Semantics/resolve76.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! 15.6.2.5(3) diff --git a/flang/test/Semantics/resolve77.f90 b/flang/test/Semantics/resolve77.f90 index 4d34ce3..efd04d9 100644 --- a/flang/test/Semantics/resolve77.f90 +++ b/flang/test/Semantics/resolve77.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Tests valid and invalid usage of forward references to procedures ! in specification expressions. module m diff --git a/flang/test/Semantics/resolve78.f90 b/flang/test/Semantics/resolve78.f90 index 0e4efc0..280e125 100644 --- a/flang/test/Semantics/resolve78.f90 +++ b/flang/test/Semantics/resolve78.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m ! C743 No component-attr-spec shall appear more than once in a ! given component-def-stmt. diff --git a/flang/test/Semantics/resolve79.f90 b/flang/test/Semantics/resolve79.f90 index 5d0e212..3bac3bf 100644 --- a/flang/test/Semantics/resolve79.f90 +++ b/flang/test/Semantics/resolve79.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m ! C755 The same proc-component-attr-spec shall not appear more than once in a ! given proc-component-def-stmt. diff --git a/flang/test/Semantics/resolve80.f90 b/flang/test/Semantics/resolve80.f90 index 98f5c79..4a196e2 100644 --- a/flang/test/Semantics/resolve80.f90 +++ b/flang/test/Semantics/resolve80.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m !C778 The same binding-attr shall not appear more than once in a given !binding-attr-list. diff --git a/flang/test/Semantics/resolve81.f90 b/flang/test/Semantics/resolve81.f90 index 218d74e..14f80ac 100644 --- a/flang/test/Semantics/resolve81.f90 +++ b/flang/test/Semantics/resolve81.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C801 The same attr-spec shall not appear more than once in a given ! type-declaration-stmt. ! diff --git a/flang/test/Semantics/resolve82.f90 b/flang/test/Semantics/resolve82.f90 index 378e879..673abaa 100644 --- a/flang/test/Semantics/resolve82.f90 +++ b/flang/test/Semantics/resolve82.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C815 An entity shall not be explicitly given any attribute more than once in ! a scoping unit. ! diff --git a/flang/test/Semantics/resolve83.f90 b/flang/test/Semantics/resolve83.f90 index cdd528a..c7a4502 100644 --- a/flang/test/Semantics/resolve83.f90 +++ b/flang/test/Semantics/resolve83.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m ! For C1543 diff --git a/flang/test/Semantics/resolve84.f90 b/flang/test/Semantics/resolve84.f90 index 79e393f..06afdfc 100644 --- a/flang/test/Semantics/resolve84.f90 +++ b/flang/test/Semantics/resolve84.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! C729 A derived type type-name shall not be DOUBLEPRECISION or the same as ! the name of any intrinsic type defined in this document. subroutine s() diff --git a/flang/test/Semantics/resolve85.f90 b/flang/test/Semantics/resolve85.f90 index d228b7d..99391a3 100644 --- a/flang/test/Semantics/resolve85.f90 +++ b/flang/test/Semantics/resolve85.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t module m ! C730 The same type-attr-spec shall not appear more than once in a given ! derived-type-stmt. diff --git a/flang/test/Semantics/separate-mp01.f90 b/flang/test/Semantics/separate-mp01.f90 index 305c147..b34b350 100644 --- a/flang/test/Semantics/separate-mp01.f90 +++ b/flang/test/Semantics/separate-mp01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! case 1: ma_create_new_fun' was not declared a separate module procedure module m1 diff --git a/flang/test/Semantics/separate-mp02.f90 b/flang/test/Semantics/separate-mp02.f90 index 1f514c2..823bfac 100644 --- a/flang/test/Semantics/separate-mp02.f90 +++ b/flang/test/Semantics/separate-mp02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! When a module subprogram has the MODULE prefix the following must match ! with the corresponding separate module procedure interface body: diff --git a/flang/test/Semantics/stop01.f90 b/flang/test/Semantics/stop01.f90 index 2ae8d65..69c5ad8 100644 --- a/flang/test/Semantics/stop01.f90 +++ b/flang/test/Semantics/stop01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t program main implicit none integer :: i = -1 diff --git a/flang/test/Semantics/structconst01.f90 b/flang/test/Semantics/structconst01.f90 index 68f0261..cdd2e77 100644 --- a/flang/test/Semantics/structconst01.f90 +++ b/flang/test/Semantics/structconst01.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for structure constructors. ! Errors caught by name resolution are tested elsewhere; these are the ! errors meant to be caught by expression semantic analysis, as well as diff --git a/flang/test/Semantics/structconst02.f90 b/flang/test/Semantics/structconst02.f90 index 2242865..a309b02 100644 --- a/flang/test/Semantics/structconst02.f90 +++ b/flang/test/Semantics/structconst02.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for structure constructors: per-component type ! (in)compatibility. diff --git a/flang/test/Semantics/structconst03.f90 b/flang/test/Semantics/structconst03.f90 index 776b4d0..01d4072 100644 --- a/flang/test/Semantics/structconst03.f90 +++ b/flang/test/Semantics/structconst03.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for structure constructors: C1594 violations ! from assigning globally-visible data to POINTER components. ! test/Semantics/structconst04.f90 is this same test without type diff --git a/flang/test/Semantics/structconst04.f90 b/flang/test/Semantics/structconst04.f90 index 07a9d69..3f0b21c 100644 --- a/flang/test/Semantics/structconst04.f90 +++ b/flang/test/Semantics/structconst04.f90 @@ -1,4 +1,4 @@ -! RUN: %S/test_errors.sh %s %flang %t +! RUN: %B/test/Semantics/test_errors.sh %s %flang %t ! Error tests for structure constructors: C1594 violations ! from assigning globally-visible data to POINTER components. ! This test is structconst03.f90 with the type parameters removed. diff --git a/flang/test/Semantics/test_any.sh b/flang/test/Semantics/test_any.sh index b0735935..19fa22f 100755 --- a/flang/test/Semantics/test_any.sh +++ b/flang/test/Semantics/test_any.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#/usr/bin/env bash # Compile a source file with '-funparse-with-symbols' and verify # we get the right symbols in the output, i.e. the output should be # the same as the input, except for the copyright comment. @@ -7,7 +7,7 @@ srcdir=$(dirname $0) source $srcdir/common.sh -FileCheck=${FileCheck:=internal_check} +FileCheck=internal_check function internal_check() { r=true diff --git a/flang/test/Semantics/test_errors.sh b/flang/test/Semantics/test_errors.sh.in similarity index 93% rename from flang/test/Semantics/test_errors.sh rename to flang/test/Semantics/test_errors.sh.in index 9fcb06b..535ded3 100755 --- a/flang/test/Semantics/test_errors.sh +++ b/flang/test/Semantics/test_errors.sh.in @@ -3,7 +3,7 @@ # Change the compiler by setting the F18 environment variable. F18_OPTIONS="-fdebug-resolve-names -fparse-only" -srcdir=$(dirname $0) +srcdir="@CMAKE_CURRENT_SOURCE_DIR@" source $srcdir/common.sh [[ ! -f $src ]] && die "File not found: $src" @@ -12,7 +12,7 @@ actual=$temp/actual expect=$temp/expect diffs=$temp/diffs -include=$(dirname $(dirname $F18))/include +include="@FLANG_INTRINSIC_MODULES_DIR@" cmd="$F18 $F18_OPTIONS $USER_OPTIONS -I$include $src" ( cd $temp; $cmd ) > $log 2>&1 if [[ $? -ge 128 ]]; then diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py index 57dc738..439f971 100644 --- a/flang/test/lit.cfg.py +++ b/flang/test/lit.cfg.py @@ -54,6 +54,8 @@ if config.flang_llvm_tools_dir != "" : if config.llvm_tools_dir != config.flang_llvm_tools_dir : llvm_config.with_environment('PATH', config.flang_llvm_tools_dir, append_path=True) +config.substitutions.append(('%B', config.flang_obj_root)) + # For each occurrence of a flang tool name, replace it with the full path to # the build directory holding that tool. We explicitly specify the directories # to search to ensure that we get the tools just built and not some random @@ -71,4 +73,4 @@ llvm_config.add_tool_substitutions(tools, tool_dirs) # Enable libpgmath testing result = lit_config.params.get("LIBPGMATH") if result: - config.environment["LIBPGMATH"] = True \ No newline at end of file + config.environment["LIBPGMATH"] = True diff --git a/flang/tools/CMakeLists.txt b/flang/tools/CMakeLists.txt index a026794..b973127 100644 --- a/flang/tools/CMakeLists.txt +++ b/flang/tools/CMakeLists.txt @@ -10,3 +10,4 @@ add_subdirectory(f18) if(LINK_WITH_FIR) add_subdirectory(tco) endif() +add_subdirectory(f18-parse-demo) diff --git a/flang/tools/f18-parse-demo/CMakeLists.txt b/flang/tools/f18-parse-demo/CMakeLists.txt new file mode 100644 index 0000000..fc64a3f --- /dev/null +++ b/flang/tools/f18-parse-demo/CMakeLists.txt @@ -0,0 +1,13 @@ +add_llvm_tool(f18-parse-demo + f18-parse-demo.cpp + stub-evaluate.cpp + ) +set_property(TARGET f18-parse-demo PROPERTY CXX_STANDARD 17) +target_compile_features(f18-parse-demo PRIVATE cxx_std_17) + +target_link_libraries(f18-parse-demo + PRIVATE + FortranParser + ) + +#install(TARGETS f18-parse-demo DESTINATION bin) diff --git a/flang/tools/f18/f18-parse-demo.cpp b/flang/tools/f18-parse-demo/f18-parse-demo.cpp similarity index 100% rename from flang/tools/f18/f18-parse-demo.cpp rename to flang/tools/f18-parse-demo/f18-parse-demo.cpp diff --git a/flang/tools/f18/stub-evaluate.cpp b/flang/tools/f18-parse-demo/stub-evaluate.cpp similarity index 100% rename from flang/tools/f18/stub-evaluate.cpp rename to flang/tools/f18-parse-demo/stub-evaluate.cpp diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index b2f8e12..8745f7c 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -1,20 +1,12 @@ -#===-- tools/f18/CMakeLists.txt --------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include") - -add_executable(f18 - f18.cpp +add_llvm_tool(f18 dump.cpp + f18.cpp ) +set_property(TARGET f18 PROPERTY CXX_STANDARD 17) +target_compile_features(f18 PRIVATE cxx_std_17) target_link_libraries(f18 + PRIVATE FortranParser FortranEvaluate FortranSemantics @@ -22,20 +14,6 @@ target_link_libraries(f18 LLVMSupport ) -add_executable(f18-parse-demo - f18-parse-demo.cpp - stub-evaluate.cpp -) - -target_link_libraries(f18-parse-demo - FortranParser -) - -set_target_properties(f18 f18-parse-demo - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" -) - set(MODULES "ieee_arithmetic" "ieee_exceptions" @@ -46,7 +24,9 @@ set(MODULES "__fortran_builtins" ) -set(include ${CMAKE_CURRENT_BINARY_DIR}/include) +set(include ${FLANG_BINARY_DIR}/include/flang) + +set(include ${FLANG_BINARY_DIR}/include/flang) # Create module files directly from the top-level module source directory foreach(filename ${MODULES}) @@ -57,9 +37,9 @@ foreach(filename ${MODULES}) endif() add_custom_command(OUTPUT ${include}/${filename}.mod COMMAND f18 -fparse-only -I${include} - ${PROJECT_SOURCE_DIR}/module/${filename}.f90 + ${FLANG_SOURCE_DIR}/module/${filename}.f90 WORKING_DIRECTORY ${include} - DEPENDS f18 ${PROJECT_SOURCE_DIR}/module/${filename}.f90 ${depends} + DEPENDS f18 ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends} ) add_custom_command(OUTPUT ${include}/${filename}.f18.mod DEPENDS ${include}/${filename}.mod @@ -67,21 +47,19 @@ foreach(filename ${MODULES}) copy ${include}/${filename}.mod ${include}/${filename}.f18.mod) list(APPEND MODULE_FILES ${include}/${filename}.mod) list(APPEND MODULE_FILES ${include}/${filename}.f18.mod) - install(FILES ${include}/${filename}.mod DESTINATION include) - install(FILES ${include}/${filename}.f18.mod DESTINATION include) + install(FILES ${include}/${filename}.mod DESTINATION include/flang) + install(FILES ${include}/${filename}.f18.mod DESTINATION include/flang) endforeach() add_custom_target(module_files ALL DEPENDS ${MODULE_FILES}) -install(TARGETS f18 f18-parse-demo DESTINATION bin) +install(TARGETS f18 DESTINATION bin) -file(COPY flang.sh - DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/bin" - FILE_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE -) -file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/bin/flang.sh" "${CMAKE_CURRENT_BINARY_DIR}/bin/flang") +set(FLANG_INTRINSIC_MODULES_DIR ${FLANG_BINARY_DIR}/include/flang) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.sh.in ${CMAKE_BINARY_DIR}/tools/flang/bin/flang @ONLY) +file(COPY ${CMAKE_BINARY_DIR}/tools/flang/bin/flang DESTINATION ${CMAKE_BINARY_DIR}/bin FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE) +# The flang script to be installed needs a different path to the headers. +set(FLANG_INTRINSIC_MODULES_DIR ${CMAKE_INSTALL_PREFIX}/include/flang) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.sh.in ${FLANG_BINARY_DIR}/bin/flang-install.sh @ONLY) -install(PROGRAMS flang.sh DESTINATION bin RENAME flang) +install(PROGRAMS ${FLANG_BINARY_DIR}/bin/flang-install.sh DESTINATION bin RENAME flang PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE) diff --git a/flang/tools/f18/flang.sh b/flang/tools/f18/flang.sh.in similarity index 95% rename from flang/tools/f18/flang.sh rename to flang/tools/f18/flang.sh.in index bf37e99f..7f0d133 100644 --- a/flang/tools/f18/flang.sh +++ b/flang/tools/f18/flang.sh.in @@ -26,4 +26,4 @@ function abspath() { wd=`abspath $(dirname "$0")/..` -${wd}/bin/f18 -module-suffix .f18.mod -intrinsic-module-directory ${wd}/include $* +${wd}/bin/f18 -module-suffix .f18.mod -intrinsic-module-directory @FLANG_INTRINSIC_MODULES_DIR@ $* diff --git a/flang/unittests/CMakeLists.txt b/flang/unittests/CMakeLists.txt index 6d49e6c..2171927 100644 --- a/flang/unittests/CMakeLists.txt +++ b/flang/unittests/CMakeLists.txt @@ -1,11 +1,3 @@ -#===-- test/CMakeLists.txt -------------------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - add_subdirectory(Decimal) add_subdirectory(Evaluate) add_subdirectory(Runtime) diff --git a/flang/unittests/Decimal/CMakeLists.txt b/flang/unittests/Decimal/CMakeLists.txt index 780c92e..f26aca5 100644 --- a/flang/unittests/Decimal/CMakeLists.txt +++ b/flang/unittests/Decimal/CMakeLists.txt @@ -1,11 +1,4 @@ -#===-- test/Decimal/CMakeLists.txt -----------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_executable(quick-sanity-test quick-sanity-test.cpp ) @@ -24,4 +17,4 @@ target_link_libraries(thorough-test LLVMSupport ) -add_test(Sanity quick-sanity-test) +add_test(NAME Sanity COMMAND quick-sanity-test) diff --git a/flang/unittests/Evaluate/CMakeLists.txt b/flang/unittests/Evaluate/CMakeLists.txt index fb195ae..54c816e 100644 --- a/flang/unittests/Evaluate/CMakeLists.txt +++ b/flang/unittests/Evaluate/CMakeLists.txt @@ -1,11 +1,4 @@ -#===-- test/Evaluate/CMakeLists.txt ----------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# - +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_library(FortranEvaluateTesting testing.cpp fp-testing.cpp diff --git a/flang/unittests/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt index 3f73b79..a5297ac 100644 --- a/flang/unittests/Runtime/CMakeLists.txt +++ b/flang/unittests/Runtime/CMakeLists.txt @@ -1,18 +1,11 @@ -#===-- test/Runtime/CMakeLists.txt -----------------------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#------------------------------------------------------------------------------# - if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") endif() +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_library(RuntimeTesting testing.cpp -) + ) add_executable(format-test format.cpp @@ -24,7 +17,7 @@ target_link_libraries(format-test LLVMSupport ) -add_test(Format format-test) +add_test(NAME Format COMMAND format-test) add_executable(hello-world hello.cpp @@ -36,7 +29,7 @@ target_link_libraries(hello-world LLVMSupport ) -add_test(HelloWorld hello-world) +add_test(NAME HelloWorld COMMAND hello-world) add_executable(external-hello-world external-hello.cpp @@ -49,7 +42,7 @@ target_link_libraries(external-hello-world add_executable(list-input-test list-input.cpp -) + ) target_link_libraries(list-input-test FortranRuntime @@ -57,4 +50,4 @@ target_link_libraries(list-input-test LLVMSupport ) -add_test(ListInput list-input-test) +add_test(NAME ListInput COMMAND list-input-test) -- 2.7.4