[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/124417 >From 71015c8f9ab17431d052472aec99dc67929a166e Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 24 Jan 2025 16:30:47 +0100 Subject: [PATCH] [Flang] Promote FortranEvaluateTesting library --- .../flang/Testing}/fp-testing.h | 14 ++-- .../flang/Testing}/testing.h | 14 ++-- flang/lib/CMakeLists.txt | 4 +++ flang/lib/Testing/CMakeLists.txt | 20 +++ .../Evaluate => lib/Testing}/fp-testing.cpp | 10 +- .../Evaluate => lib/Testing}/testing.cpp | 10 +- flang/unittests/Evaluate/CMakeLists.txt | 35 ++- .../Evaluate/ISO-Fortran-binding.cpp | 2 +- .../Evaluate/bit-population-count.cpp | 2 +- flang/unittests/Evaluate/expression.cpp | 2 +- flang/unittests/Evaluate/folding.cpp | 2 +- flang/unittests/Evaluate/integer.cpp | 2 +- flang/unittests/Evaluate/intrinsics.cpp | 2 +- .../Evaluate/leading-zero-bit-count.cpp | 2 +- flang/unittests/Evaluate/logical.cpp | 2 +- flang/unittests/Evaluate/real.cpp | 4 +-- flang/unittests/Evaluate/reshape.cpp | 2 +- flang/unittests/Evaluate/uint128.cpp | 2 +- 18 files changed, 87 insertions(+), 44 deletions(-) rename flang/{unittests/Evaluate => include/flang/Testing}/fp-testing.h (54%) rename flang/{unittests/Evaluate => include/flang/Testing}/testing.h (74%) create mode 100644 flang/lib/Testing/CMakeLists.txt rename flang/{unittests/Evaluate => lib/Testing}/fp-testing.cpp (87%) rename flang/{unittests/Evaluate => lib/Testing}/testing.cpp (88%) diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/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 +# +#===
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/124417 >From 71015c8f9ab17431d052472aec99dc67929a166e Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 24 Jan 2025 16:30:47 +0100 Subject: [PATCH] [Flang] Promote FortranEvaluateTesting library --- .../flang/Testing}/fp-testing.h | 14 ++-- .../flang/Testing}/testing.h | 14 ++-- flang/lib/CMakeLists.txt | 4 +++ flang/lib/Testing/CMakeLists.txt | 20 +++ .../Evaluate => lib/Testing}/fp-testing.cpp | 10 +- .../Evaluate => lib/Testing}/testing.cpp | 10 +- flang/unittests/Evaluate/CMakeLists.txt | 35 ++- .../Evaluate/ISO-Fortran-binding.cpp | 2 +- .../Evaluate/bit-population-count.cpp | 2 +- flang/unittests/Evaluate/expression.cpp | 2 +- flang/unittests/Evaluate/folding.cpp | 2 +- flang/unittests/Evaluate/integer.cpp | 2 +- flang/unittests/Evaluate/intrinsics.cpp | 2 +- .../Evaluate/leading-zero-bit-count.cpp | 2 +- flang/unittests/Evaluate/logical.cpp | 2 +- flang/unittests/Evaluate/real.cpp | 4 +-- flang/unittests/Evaluate/reshape.cpp | 2 +- flang/unittests/Evaluate/uint128.cpp | 2 +- 18 files changed, 87 insertions(+), 44 deletions(-) rename flang/{unittests/Evaluate => include/flang/Testing}/fp-testing.h (54%) rename flang/{unittests/Evaluate => include/flang/Testing}/testing.h (74%) create mode 100644 flang/lib/Testing/CMakeLists.txt rename flang/{unittests/Evaluate => lib/Testing}/fp-testing.cpp (87%) rename flang/{unittests/Evaluate => lib/Testing}/testing.cpp (88%) diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/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 +# +#===
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/124417 >From 71015c8f9ab17431d052472aec99dc67929a166e Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 24 Jan 2025 16:30:47 +0100 Subject: [PATCH] [Flang] Promote FortranEvaluateTesting library --- .../flang/Testing}/fp-testing.h | 14 ++-- .../flang/Testing}/testing.h | 14 ++-- flang/lib/CMakeLists.txt | 4 +++ flang/lib/Testing/CMakeLists.txt | 20 +++ .../Evaluate => lib/Testing}/fp-testing.cpp | 10 +- .../Evaluate => lib/Testing}/testing.cpp | 10 +- flang/unittests/Evaluate/CMakeLists.txt | 35 ++- .../Evaluate/ISO-Fortran-binding.cpp | 2 +- .../Evaluate/bit-population-count.cpp | 2 +- flang/unittests/Evaluate/expression.cpp | 2 +- flang/unittests/Evaluate/folding.cpp | 2 +- flang/unittests/Evaluate/integer.cpp | 2 +- flang/unittests/Evaluate/intrinsics.cpp | 2 +- .../Evaluate/leading-zero-bit-count.cpp | 2 +- flang/unittests/Evaluate/logical.cpp | 2 +- flang/unittests/Evaluate/real.cpp | 4 +-- flang/unittests/Evaluate/reshape.cpp | 2 +- flang/unittests/Evaluate/uint128.cpp | 2 +- 18 files changed, 87 insertions(+), 44 deletions(-) rename flang/{unittests/Evaluate => include/flang/Testing}/fp-testing.h (54%) rename flang/{unittests/Evaluate => include/flang/Testing}/testing.h (74%) create mode 100644 flang/lib/Testing/CMakeLists.txt rename flang/{unittests/Evaluate => lib/Testing}/fp-testing.cpp (87%) rename flang/{unittests/Evaluate => lib/Testing}/testing.cpp (88%) diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/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 +# +#===
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/jeanPerier approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/124417 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/124417 >From 71015c8f9ab17431d052472aec99dc67929a166e Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 24 Jan 2025 16:30:47 +0100 Subject: [PATCH] [Flang] Promote FortranEvaluateTesting library --- .../flang/Testing}/fp-testing.h | 14 ++-- .../flang/Testing}/testing.h | 14 ++-- flang/lib/CMakeLists.txt | 4 +++ flang/lib/Testing/CMakeLists.txt | 20 +++ .../Evaluate => lib/Testing}/fp-testing.cpp | 10 +- .../Evaluate => lib/Testing}/testing.cpp | 10 +- flang/unittests/Evaluate/CMakeLists.txt | 35 ++- .../Evaluate/ISO-Fortran-binding.cpp | 2 +- .../Evaluate/bit-population-count.cpp | 2 +- flang/unittests/Evaluate/expression.cpp | 2 +- flang/unittests/Evaluate/folding.cpp | 2 +- flang/unittests/Evaluate/integer.cpp | 2 +- flang/unittests/Evaluate/intrinsics.cpp | 2 +- .../Evaluate/leading-zero-bit-count.cpp | 2 +- flang/unittests/Evaluate/logical.cpp | 2 +- flang/unittests/Evaluate/real.cpp | 4 +-- flang/unittests/Evaluate/reshape.cpp | 2 +- flang/unittests/Evaluate/uint128.cpp | 2 +- 18 files changed, 87 insertions(+), 44 deletions(-) rename flang/{unittests/Evaluate => include/flang/Testing}/fp-testing.h (54%) rename flang/{unittests/Evaluate => include/flang/Testing}/testing.h (74%) create mode 100644 flang/lib/Testing/CMakeLists.txt rename flang/{unittests/Evaluate => lib/Testing}/fp-testing.cpp (87%) rename flang/{unittests/Evaluate => lib/Testing}/testing.cpp (88%) diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/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 +# +#===
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/124417 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
llvmbot wrote: @llvm/pr-subscribers-flang-semantics Author: Michael Kruse (Meinersbur) Changes The non-GTest library will be shared by unittests of Flang and Flang-RT. Promote it as a regular library for use by both projects. Extracted out of #110217 In the long term, we may want to convert these to regular GTest checks to avoid having multiple testing frameworks. --- Full diff: https://github.com/llvm/llvm-project/pull/124417.diff 18 Files Affected: - (renamed) flang/include/flang/Testing/fp-testing.h (+11-3) - (renamed) flang/include/flang/Testing/testing.h (+11-3) - (modified) flang/lib/CMakeLists.txt (+4) - (added) flang/lib/Testing/CMakeLists.txt (+20) - (renamed) flang/lib/Testing/fp-testing.cpp (+9-1) - (renamed) flang/lib/Testing/testing.cpp (+9-1) - (modified) flang/unittests/Evaluate/CMakeLists.txt (+11-24) - (modified) flang/unittests/Evaluate/ISO-Fortran-binding.cpp (+1-1) - (modified) flang/unittests/Evaluate/bit-population-count.cpp (+1-1) - (modified) flang/unittests/Evaluate/expression.cpp (+1-1) - (modified) flang/unittests/Evaluate/folding.cpp (+1-1) - (modified) flang/unittests/Evaluate/integer.cpp (+1-1) - (modified) flang/unittests/Evaluate/intrinsics.cpp (+1-1) - (modified) flang/unittests/Evaluate/leading-zero-bit-count.cpp (+1-1) - (modified) flang/unittests/Evaluate/logical.cpp (+1-1) - (modified) flang/unittests/Evaluate/real.cpp (+2-2) - (modified) flang/unittests/Evaluate/reshape.cpp (+1-1) - (modified) flang/unittests/Evaluate/uint128.cpp (+1-1) ``diff diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/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(NonGTestTesting EXCLUDE_FROM_ALL +testing.cpp +fp-testing.cpp +) +set_target_properties(NonGTestTesting PROPER
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur ready_for_review https://github.com/llvm/llvm-project/pull/124417 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [Flang] Promote FortranEvaluateTesting library (PR #124417)
https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/124417 The non-GTest library will be shared by unittests of Flang and Flang-RT. Promote it as a regular library for use by both projects. Extracted out of #110217 In the long term, we may want to convert these to regular GTest checks to avoid having multiple testing frameworks. >From 71015c8f9ab17431d052472aec99dc67929a166e Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 24 Jan 2025 16:30:47 +0100 Subject: [PATCH] [Flang] Promote FortranEvaluateTesting library --- .../flang/Testing}/fp-testing.h | 14 ++-- .../flang/Testing}/testing.h | 14 ++-- flang/lib/CMakeLists.txt | 4 +++ flang/lib/Testing/CMakeLists.txt | 20 +++ .../Evaluate => lib/Testing}/fp-testing.cpp | 10 +- .../Evaluate => lib/Testing}/testing.cpp | 10 +- flang/unittests/Evaluate/CMakeLists.txt | 35 ++- .../Evaluate/ISO-Fortran-binding.cpp | 2 +- .../Evaluate/bit-population-count.cpp | 2 +- flang/unittests/Evaluate/expression.cpp | 2 +- flang/unittests/Evaluate/folding.cpp | 2 +- flang/unittests/Evaluate/integer.cpp | 2 +- flang/unittests/Evaluate/intrinsics.cpp | 2 +- .../Evaluate/leading-zero-bit-count.cpp | 2 +- flang/unittests/Evaluate/logical.cpp | 2 +- flang/unittests/Evaluate/real.cpp | 4 +-- flang/unittests/Evaluate/reshape.cpp | 2 +- flang/unittests/Evaluate/uint128.cpp | 2 +- 18 files changed, 87 insertions(+), 44 deletions(-) rename flang/{unittests/Evaluate => include/flang/Testing}/fp-testing.h (54%) rename flang/{unittests/Evaluate => include/flang/Testing}/testing.h (74%) create mode 100644 flang/lib/Testing/CMakeLists.txt rename flang/{unittests/Evaluate => lib/Testing}/fp-testing.cpp (87%) rename flang/{unittests/Evaluate => lib/Testing}/testing.cpp (88%) diff --git a/flang/unittests/Evaluate/fp-testing.h b/flang/include/flang/Testing/fp-testing.h similarity index 54% rename from flang/unittests/Evaluate/fp-testing.h rename to flang/include/flang/Testing/fp-testing.h index 9091963a99b32d..e223d2ef7d1b8b 100644 --- a/flang/unittests/Evaluate/fp-testing.h +++ b/flang/include/flang/Testing/fp-testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_ -#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +//===-- include/flang/Testing/fp-testing.h --*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_FP_TESTING_H_ +#define FORTRAN_TESTING_FP_TESTING_H_ #include "flang/Common/target-rounding.h" #include @@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment { #endif }; -#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_ +#endif /* FORTRAN_TESTING_FP_TESTING_H_ */ diff --git a/flang/unittests/Evaluate/testing.h b/flang/include/flang/Testing/testing.h similarity index 74% rename from flang/unittests/Evaluate/testing.h rename to flang/include/flang/Testing/testing.h index 422e2853c05bc6..404650c9a89f2c 100644 --- a/flang/unittests/Evaluate/testing.h +++ b/flang/include/flang/Testing/testing.h @@ -1,5 +1,13 @@ -#ifndef FORTRAN_EVALUATE_TESTING_H_ -#define FORTRAN_EVALUATE_TESTING_H_ +//===-- include/flang/Testing/testing.h -*- C++ -*-===// +// +// 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 +// +//===--===// + +#ifndef FORTRAN_TESTING_TESTING_H_ +#define FORTRAN_TESTING_TESTING_H_ #include #include @@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want, FailureDetailPrinter Compare(const char *file, int line, const char *xs, const char *rel, const char *ys, std::uint64_t x, std::uint64_t y); } // namespace testing -#endif // FORTRAN_EVALUATE_TESTING_H_ +#endif /* FORTRAN_TESTING_TESTING_H_ */ diff --git a/flang/lib/CMakeLists.txt b/flang/lib/CMakeLists.txt index 05c3535b09b3d3..8b201d9a758a80 100644 --- a/flang/lib/CMakeLists.txt +++ b/flang/lib/CMakeLists.txt @@ -8,3 +8,7 @@ add_subdirectory(Frontend) add_subdirectory(FrontendTool) add_subdirectory(Optimizer) + +if (FLANG_INCLUDE_TESTS) + add_subdirectory(Testing) +endif () diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt new file mode 100644 index 00..8051bc09736d16 --- /dev/null +++ b/flang/lib/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +#===-- lib/Testing/CMakeLists.txt --