From ee5fa1f2338abb2dace0c43116cd73c283f96a3b Mon Sep 17 00:00:00 2001 From: Luke Ireland Date: Wed, 19 Feb 2020 15:49:33 +0000 Subject: [PATCH] [flang] Create a separate directory for unittests Some of the regression tests are C programs that act as test harnesses for the compiler internals as opposed to being Fortran inputs to test the compiler in action. The former style of tests are analog to LLVM's unittests and will not use the lit framework. Change-Id: I0ff10e23f66ff843e8fff4c35cfb6559b9dab762 Original-commit: flang-compiler/f18@2bfddbe8f8898551a28c3ea07b7ae508018f8634 Reviewed-on: https://github.com/flang-compiler/f18/pull/1027 Tree-same-pre-rewrite: false --- flang/CMakeLists.txt | 2 +- flang/{test => unittests}/CMakeLists.txt | 1 - .../Decimal/CMakeLists.txt | 0 .../Decimal/quick-sanity-test.cpp | 0 .../Decimal/thorough-test.cpp | 0 .../Evaluate/CMakeLists.txt | 25 ------------------- .../Evaluate/ISO-Fortran-binding.cpp | 0 .../Evaluate/bit-population-count.cpp | 0 .../Evaluate/expression.cpp | 0 .../{test => unittests}/Evaluate/folding.cpp | 0 .../Evaluate/fp-testing.cpp | 0 .../{test => unittests}/Evaluate/fp-testing.h | 0 .../{test => unittests}/Evaluate/integer.cpp | 0 .../Evaluate/intrinsics.cpp | 0 .../Evaluate/leading-zero-bit-count.cpp | 0 .../{test => unittests}/Evaluate/logical.cpp | 0 flang/{test => unittests}/Evaluate/real.cpp | 0 .../{test => unittests}/Evaluate/reshape.cpp | 0 .../{test => unittests}/Evaluate/testing.cpp | 0 flang/{test => unittests}/Evaluate/testing.h | 0 .../{test => unittests}/Evaluate/uint128.cpp | 0 .../Runtime/CMakeLists.txt | 0 .../Runtime/external-hello.cpp | 0 flang/{test => unittests}/Runtime/format.cpp | 0 flang/{test => unittests}/Runtime/hello.cpp | 0 .../Runtime/list-input.cpp | 0 flang/{test => unittests}/Runtime/testing.cpp | 0 flang/{test => unittests}/Runtime/testing.h | 0 28 files changed, 1 insertion(+), 27 deletions(-) rename flang/{test => unittests}/CMakeLists.txt (94%) rename flang/{test => unittests}/Decimal/CMakeLists.txt (100%) rename flang/{test => unittests}/Decimal/quick-sanity-test.cpp (100%) rename flang/{test => unittests}/Decimal/thorough-test.cpp (100%) rename flang/{test => unittests}/Evaluate/CMakeLists.txt (85%) rename flang/{test => unittests}/Evaluate/ISO-Fortran-binding.cpp (100%) rename flang/{test => unittests}/Evaluate/bit-population-count.cpp (100%) rename flang/{test => unittests}/Evaluate/expression.cpp (100%) rename flang/{test => unittests}/Evaluate/folding.cpp (100%) rename flang/{test => unittests}/Evaluate/fp-testing.cpp (100%) rename flang/{test => unittests}/Evaluate/fp-testing.h (100%) rename flang/{test => unittests}/Evaluate/integer.cpp (100%) rename flang/{test => unittests}/Evaluate/intrinsics.cpp (100%) rename flang/{test => unittests}/Evaluate/leading-zero-bit-count.cpp (100%) rename flang/{test => unittests}/Evaluate/logical.cpp (100%) rename flang/{test => unittests}/Evaluate/real.cpp (100%) rename flang/{test => unittests}/Evaluate/reshape.cpp (100%) rename flang/{test => unittests}/Evaluate/testing.cpp (100%) rename flang/{test => unittests}/Evaluate/testing.h (100%) rename flang/{test => unittests}/Evaluate/uint128.cpp (100%) rename flang/{test => unittests}/Runtime/CMakeLists.txt (100%) rename flang/{test => unittests}/Runtime/external-hello.cpp (100%) rename flang/{test => unittests}/Runtime/format.cpp (100%) rename flang/{test => unittests}/Runtime/hello.cpp (100%) rename flang/{test => unittests}/Runtime/list-input.cpp (100%) rename flang/{test => unittests}/Runtime/testing.cpp (100%) rename flang/{test => unittests}/Runtime/testing.h (100%) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 97a03ee4a9a3..f19259df77e1 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -154,7 +154,7 @@ enable_testing() add_subdirectory(include/flang) add_subdirectory(lib) add_subdirectory(runtime) -add_subdirectory(test) +add_subdirectory(unittests) add_subdirectory(tools) add_subdirectory(test-lit) diff --git a/flang/test/CMakeLists.txt b/flang/unittests/CMakeLists.txt similarity index 94% rename from flang/test/CMakeLists.txt rename to flang/unittests/CMakeLists.txt index e83f63c8e030..6d49e6c72b57 100644 --- a/flang/test/CMakeLists.txt +++ b/flang/unittests/CMakeLists.txt @@ -9,4 +9,3 @@ add_subdirectory(Decimal) add_subdirectory(Evaluate) add_subdirectory(Runtime) -add_subdirectory(Semantics) diff --git a/flang/test/Decimal/CMakeLists.txt b/flang/unittests/Decimal/CMakeLists.txt similarity index 100% rename from flang/test/Decimal/CMakeLists.txt rename to flang/unittests/Decimal/CMakeLists.txt diff --git a/flang/test/Decimal/quick-sanity-test.cpp b/flang/unittests/Decimal/quick-sanity-test.cpp similarity index 100% rename from flang/test/Decimal/quick-sanity-test.cpp rename to flang/unittests/Decimal/quick-sanity-test.cpp diff --git a/flang/test/Decimal/thorough-test.cpp b/flang/unittests/Decimal/thorough-test.cpp similarity index 100% rename from flang/test/Decimal/thorough-test.cpp rename to flang/unittests/Decimal/thorough-test.cpp diff --git a/flang/test/Evaluate/CMakeLists.txt b/flang/unittests/Evaluate/CMakeLists.txt similarity index 85% rename from flang/test/Evaluate/CMakeLists.txt rename to flang/unittests/Evaluate/CMakeLists.txt index b08c1431df70..d874fcb39dbc 100644 --- a/flang/test/Evaluate/CMakeLists.txt +++ b/flang/unittests/Evaluate/CMakeLists.txt @@ -132,18 +132,6 @@ target_link_libraries(folding-test FortranSemantics ) -set(FOLDING_TESTS - folding01.f90 - folding02.f90 - folding03.f90 - folding04.f90 - folding05.f90 - folding06.f90 - folding07.f90 - folding08.f90 - folding09.f90 -) - add_test(Expression expression-test) add_test(Integer integer-test) add_test(Intrinsics intrinsics-test) @@ -152,16 +140,3 @@ add_test(Real real-test) add_test(RESHAPE reshape-test) add_test(ISO-binding ISO-Fortran-binding-test) add_test(folding folding-test) - -set(TEST_LIBPGMATH "-pgmath=false") -if (LIBPGMATH_DIR) - find_library(LIBPGMATH pgmath PATHS ${LIBPGMATH_DIR}) - if(LIBPGMATH) - set(TEST_LIBPGMATH "-pgmath=true") - endif() -endif() - -foreach(test ${FOLDING_TESTS}) - add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_folding.sh - ${test} ${TEST_LIBPGMATH}) -endforeach() diff --git a/flang/test/Evaluate/ISO-Fortran-binding.cpp b/flang/unittests/Evaluate/ISO-Fortran-binding.cpp similarity index 100% rename from flang/test/Evaluate/ISO-Fortran-binding.cpp rename to flang/unittests/Evaluate/ISO-Fortran-binding.cpp diff --git a/flang/test/Evaluate/bit-population-count.cpp b/flang/unittests/Evaluate/bit-population-count.cpp similarity index 100% rename from flang/test/Evaluate/bit-population-count.cpp rename to flang/unittests/Evaluate/bit-population-count.cpp diff --git a/flang/test/Evaluate/expression.cpp b/flang/unittests/Evaluate/expression.cpp similarity index 100% rename from flang/test/Evaluate/expression.cpp rename to flang/unittests/Evaluate/expression.cpp diff --git a/flang/test/Evaluate/folding.cpp b/flang/unittests/Evaluate/folding.cpp similarity index 100% rename from flang/test/Evaluate/folding.cpp rename to flang/unittests/Evaluate/folding.cpp diff --git a/flang/test/Evaluate/fp-testing.cpp b/flang/unittests/Evaluate/fp-testing.cpp similarity index 100% rename from flang/test/Evaluate/fp-testing.cpp rename to flang/unittests/Evaluate/fp-testing.cpp diff --git a/flang/test/Evaluate/fp-testing.h b/flang/unittests/Evaluate/fp-testing.h similarity index 100% rename from flang/test/Evaluate/fp-testing.h rename to flang/unittests/Evaluate/fp-testing.h diff --git a/flang/test/Evaluate/integer.cpp b/flang/unittests/Evaluate/integer.cpp similarity index 100% rename from flang/test/Evaluate/integer.cpp rename to flang/unittests/Evaluate/integer.cpp diff --git a/flang/test/Evaluate/intrinsics.cpp b/flang/unittests/Evaluate/intrinsics.cpp similarity index 100% rename from flang/test/Evaluate/intrinsics.cpp rename to flang/unittests/Evaluate/intrinsics.cpp diff --git a/flang/test/Evaluate/leading-zero-bit-count.cpp b/flang/unittests/Evaluate/leading-zero-bit-count.cpp similarity index 100% rename from flang/test/Evaluate/leading-zero-bit-count.cpp rename to flang/unittests/Evaluate/leading-zero-bit-count.cpp diff --git a/flang/test/Evaluate/logical.cpp b/flang/unittests/Evaluate/logical.cpp similarity index 100% rename from flang/test/Evaluate/logical.cpp rename to flang/unittests/Evaluate/logical.cpp diff --git a/flang/test/Evaluate/real.cpp b/flang/unittests/Evaluate/real.cpp similarity index 100% rename from flang/test/Evaluate/real.cpp rename to flang/unittests/Evaluate/real.cpp diff --git a/flang/test/Evaluate/reshape.cpp b/flang/unittests/Evaluate/reshape.cpp similarity index 100% rename from flang/test/Evaluate/reshape.cpp rename to flang/unittests/Evaluate/reshape.cpp diff --git a/flang/test/Evaluate/testing.cpp b/flang/unittests/Evaluate/testing.cpp similarity index 100% rename from flang/test/Evaluate/testing.cpp rename to flang/unittests/Evaluate/testing.cpp diff --git a/flang/test/Evaluate/testing.h b/flang/unittests/Evaluate/testing.h similarity index 100% rename from flang/test/Evaluate/testing.h rename to flang/unittests/Evaluate/testing.h diff --git a/flang/test/Evaluate/uint128.cpp b/flang/unittests/Evaluate/uint128.cpp similarity index 100% rename from flang/test/Evaluate/uint128.cpp rename to flang/unittests/Evaluate/uint128.cpp diff --git a/flang/test/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt similarity index 100% rename from flang/test/Runtime/CMakeLists.txt rename to flang/unittests/Runtime/CMakeLists.txt diff --git a/flang/test/Runtime/external-hello.cpp b/flang/unittests/Runtime/external-hello.cpp similarity index 100% rename from flang/test/Runtime/external-hello.cpp rename to flang/unittests/Runtime/external-hello.cpp diff --git a/flang/test/Runtime/format.cpp b/flang/unittests/Runtime/format.cpp similarity index 100% rename from flang/test/Runtime/format.cpp rename to flang/unittests/Runtime/format.cpp diff --git a/flang/test/Runtime/hello.cpp b/flang/unittests/Runtime/hello.cpp similarity index 100% rename from flang/test/Runtime/hello.cpp rename to flang/unittests/Runtime/hello.cpp diff --git a/flang/test/Runtime/list-input.cpp b/flang/unittests/Runtime/list-input.cpp similarity index 100% rename from flang/test/Runtime/list-input.cpp rename to flang/unittests/Runtime/list-input.cpp diff --git a/flang/test/Runtime/testing.cpp b/flang/unittests/Runtime/testing.cpp similarity index 100% rename from flang/test/Runtime/testing.cpp rename to flang/unittests/Runtime/testing.cpp diff --git a/flang/test/Runtime/testing.h b/flang/unittests/Runtime/testing.h similarity index 100% rename from flang/test/Runtime/testing.h rename to flang/unittests/Runtime/testing.h