Skip to content

Commit 4b2f932

Browse files
committed
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/meinersbur/flang_runtime_flang_rt
2 parents 268de15 + 11a9773 commit 4b2f932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+127
-96
lines changed

flang/include/flang/Common/binary-floating-point.h renamed to flang/include/flang/Decimal/binary-floating-point.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//===-- include/flang/Common/binary-floating-point.h ------------*- C++ -*-===//
1+
//===-- include/flang/Decimal/binary-floating-point.h -----------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef FORTRAN_COMMON_BINARY_FLOATING_POINT_H_
10-
#define FORTRAN_COMMON_BINARY_FLOATING_POINT_H_
9+
#ifndef FORTRAN_DECIMAL_BINARY_FLOATING_POINT_H_
10+
#define FORTRAN_DECIMAL_BINARY_FLOATING_POINT_H_
1111

1212
// Access and manipulate the fields of an IEEE-754 binary
1313
// floating-point value via a generalized template.
@@ -208,4 +208,4 @@ template <int BINARY_PRECISION> class BinaryFloatingPointNumber {
208208
RawType raw_{0};
209209
};
210210
} // namespace Fortran::decimal
211-
#endif /* FORTRAN_COMMON_BINARY_FLOATING_POINT_H_ */
211+
#endif

flang/include/flang/Common/decimal.h renamed to flang/include/flang/Decimal/decimal.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
/*===-- include/flang/Common/decimal.h ------------------------------*- C -*-===
1+
/*===-- include/flang/Decimal/decimal.h ---------------------------*- C++ -*-===
22
*
33
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
* See https://llvm.org/LICENSE.txt for license information.
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
*
7-
*===----------------------------------------------------------------------===*/
7+
* ===-----------------------------------------------------------------------===
8+
*/
89

910
/* C and C++ API for binary-to/from-decimal conversion package. */
1011

11-
#ifndef FORTRAN_COMMON_DECIMAL_H_
12-
#define FORTRAN_COMMON_DECIMAL_H_
12+
#ifndef FORTRAN_DECIMAL_DECIMAL_H_
13+
#define FORTRAN_DECIMAL_DECIMAL_H_
1314

1415
#include "flang/Common/api-attrs.h"
1516
#include <stddef.h>
@@ -136,4 +137,4 @@ RT_API_ATTRS enum NS(ConversionResultFlags) ConvertDecimalToLongDouble(
136137
#ifdef __cplusplus
137138
} // extern "C"
138139
#endif
139-
#endif /* FORTRAN_COMMON_DECIMAL_H_ */
140+
#endif

flang/unittests/Evaluate/fp-testing.h renamed to flang/include/flang/Testing/fp-testing.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
#ifndef FORTRAN_TEST_EVALUATE_FP_TESTING_H_
2-
#define FORTRAN_TEST_EVALUATE_FP_TESTING_H_
1+
//===-- include/flang/Testing/fp-testing.h ----------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef FORTRAN_TESTING_FP_TESTING_H_
10+
#define FORTRAN_TESTING_FP_TESTING_H_
311

412
#include "flang/Common/target-rounding.h"
513
#include <fenv.h>
@@ -24,4 +32,4 @@ class ScopedHostFloatingPointEnvironment {
2432
#endif
2533
};
2634

27-
#endif // FORTRAN_TEST_EVALUATE_FP_TESTING_H_
35+
#endif /* FORTRAN_TESTING_FP_TESTING_H_ */

flang/unittests/Evaluate/testing.h renamed to flang/include/flang/Testing/testing.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
#ifndef FORTRAN_EVALUATE_TESTING_H_
2-
#define FORTRAN_EVALUATE_TESTING_H_
1+
//===-- include/flang/Testing/testing.h -------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef FORTRAN_TESTING_TESTING_H_
10+
#define FORTRAN_TESTING_TESTING_H_
311

412
#include <cinttypes>
513
#include <string>
@@ -33,4 +41,4 @@ FailureDetailPrinter Match(const char *file, int line, const std::string &want,
3341
FailureDetailPrinter Compare(const char *file, int line, const char *xs,
3442
const char *rel, const char *ys, std::uint64_t x, std::uint64_t y);
3543
} // namespace testing
36-
#endif // FORTRAN_EVALUATE_TESTING_H_
44+
#endif /* FORTRAN_TESTING_TESTING_H_ */

flang/lib/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
add_subdirectory(Common)
21
add_subdirectory(Support)
32
add_subdirectory(Evaluate)
3+
add_subdirectory(Decimal)
44
add_subdirectory(Lower)
55
add_subdirectory(Parser)
66
add_subdirectory(Semantics)
77
add_subdirectory(Frontend)
88
add_subdirectory(FrontendTool)
99

1010
add_subdirectory(Optimizer)
11+
12+
if (FLANG_INCLUDE_TESTS)
13+
add_subdirectory(Testing)
14+
endif ()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#===-- lib/Common/CMakeLists.txt ------------------------------------===#
1+
#===-- lib/Decimal/CMakeLists.txt ------------------------------------------===#
22
#
33
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
# See https://llvm.org/LICENSE.txt for license information.
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
#
77
#===------------------------------------------------------------------------===#
88

9-
add_flang_library(FortranCommon
9+
add_flang_library(FortranDecimal
1010
binary-to-decimal.cpp
1111
decimal-to-binary.cpp
1212
)

flang/lib/Common/big-radix-floating-point.h renamed to flang/lib/Decimal/big-radix-floating-point.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//===-- lib/Common/big-radix-floating-point.h -------------------*- C++ -*-===//
1+
//===-- lib/Decimal/big-radix-floating-point.h ------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef FORTRAN_COMMON_BIG_RADIX_FLOATING_POINT_H_
10-
#define FORTRAN_COMMON_BIG_RADIX_FLOATING_POINT_H_
9+
#ifndef FORTRAN_DECIMAL_BIG_RADIX_FLOATING_POINT_H_
10+
#define FORTRAN_DECIMAL_BIG_RADIX_FLOATING_POINT_H_
1111

1212
// This is a helper class for use in floating-point conversions between
1313
// binary and decimal representations. It holds a multiple-precision
@@ -21,11 +21,11 @@
2121
// for conversions between binary and decimal representations; it is not
2222
// a general-purpose facility.
2323

24-
#include "flang/Common/binary-floating-point.h"
2524
#include "flang/Common/bit-population-count.h"
26-
#include "flang/Common/decimal.h"
2725
#include "flang/Common/leading-zero-bit-count.h"
2826
#include "flang/Common/uint128.h"
27+
#include "flang/Decimal/binary-floating-point.h"
28+
#include "flang/Decimal/decimal.h"
2929
#include <cinttypes>
3030
#include <limits>
3131
#include <type_traits>
@@ -393,4 +393,4 @@ template <int PREC, int LOG10RADIX = 16> class BigRadixFloatingPointNumber {
393393
enum FortranRounding rounding_ { RoundNearest };
394394
};
395395
} // namespace Fortran::decimal
396-
#endif /* FORTRAN_COMMON_BIG_RADIX_FLOATING_POINT_H_ */
396+
#endif

flang/lib/Common/binary-to-decimal.cpp renamed to flang/lib/Decimal/binary-to-decimal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- lib/Common/binary-to-decimal.cpp ------------------------*- C++ -*-===//
1+
//===-- lib/Decimal/binary-to-decimal.cpp ---------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "big-radix-floating-point.h"
10-
#include "flang/Common/decimal.h"
10+
#include "flang/Decimal/decimal.h"
1111
#include <cassert>
1212
#include <cfloat>
1313
#include <string>

flang/lib/Common/decimal-to-binary.cpp renamed to flang/lib/Decimal/decimal-to-binary.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- lib/Common/decimal-to-binary.cpp ------------------------*- C++ -*-===//
1+
//===-- lib/Decimal/decimal-to-binary.cpp ---------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,10 +7,10 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "big-radix-floating-point.h"
10-
#include "flang/Common/binary-floating-point.h"
1110
#include "flang/Common/bit-population-count.h"
12-
#include "flang/Common/decimal.h"
1311
#include "flang/Common/leading-zero-bit-count.h"
12+
#include "flang/Decimal/binary-floating-point.h"
13+
#include "flang/Decimal/decimal.h"
1414
#include "flang/Runtime/freestanding-tools.h"
1515
#include <cinttypes>
1616
#include <cstring>

flang/lib/Evaluate/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ add_flang_library(FortranEvaluate
6060
variable.cpp
6161

6262
LINK_LIBS
63-
FortranCommon
6463
FortranSupport
64+
FortranDecimal
6565
FortranParser
6666
${LIBPGMATH}
6767
${QUADMATHLIB}

flang/lib/Evaluate/real.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "flang/Evaluate/real.h"
1010
#include "int-power.h"
11-
#include "flang/Common/decimal.h"
1211
#include "flang/Common/idioms.h"
12+
#include "flang/Decimal/decimal.h"
1313
#include "flang/Parser/characters.h"
1414
#include "llvm/Support/raw_ostream.h"
1515
#include <limits>

flang/lib/Frontend/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ add_flang_library(flangFrontend
2727
FortranParser
2828
FortranSemantics
2929
FortranEvaluate
30-
FortranCommon
3130
FortranSupport
3231
FortranLower
3332
FIRDialect

flang/lib/Lower/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ add_flang_library(FortranLower
5656
HLFIRDialect
5757
${dialect_libs}
5858
${extension_libs}
59-
FortranCommon
6059
FortranSupport
6160
FortranParser
6261
FortranEvaluate

flang/lib/Optimizer/OpenMP/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ add_flang_library(FlangOpenMPTransforms
2121
FIRDialect
2222
FIRDialectSupport
2323
FIRSupport
24-
FortranCommon
2524
FortranSupport
2625
FortranEvaluate
2726
MLIRFuncDialect

flang/lib/Optimizer/Passes/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ add_flang_library(flangPasses
1111
FlangOpenMPTransforms
1212
${dialect_libs}
1313
${extension_libs}
14-
FortranCommon
1514
FortranSupport
1615
HLFIRTransforms
1716
MLIRPass

flang/lib/Optimizer/Transforms/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ add_flang_library(FIRTransforms
4646
FIRDialect
4747
FIRDialectSupport
4848
FIRSupport
49-
FortranCommon
5049
FortranSupport
5150
HLFIRDialect
5251
MLIRAffineUtils

flang/lib/Parser/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ add_flang_library(FortranParser
2525
user-state.cpp
2626

2727
LINK_LIBS
28-
FortranCommon
2928
FortranSupport
3029

3130
LINK_COMPONENTS

flang/lib/Semantics/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ add_flang_library(FortranSemantics
5353
omp_gen
5454

5555
LINK_LIBS
56-
FortranCommon
5756
FortranSupport
5857
FortranParser
5958
FortranEvaluate

flang/lib/Testing/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#===-- lib/Testing/CMakeLists.txt ------------------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
9+
add_library(NonGTestTesting EXCLUDE_FROM_ALL
10+
testing.cpp
11+
fp-testing.cpp
12+
)
13+
set_target_properties(NonGTestTesting PROPERTIES FOLDER "Flang/Tests")
14+
15+
if (LLVM_LINK_LLVM_DYLIB)
16+
set(llvm_libs LLVM)
17+
else()
18+
llvm_map_components_to_libnames(llvm_libs Support)
19+
endif()
20+
target_link_libraries(NonGTestTesting ${llvm_libs})

flang/unittests/Evaluate/fp-testing.cpp renamed to flang/lib/Testing/fp-testing.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
#include "fp-testing.h"
1+
//===-- lib/Testing/fp-testing.cpp ------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "flang/Testing/fp-testing.h"
210
#include "llvm/Support/Errno.h"
311
#include <cstdio>
412
#include <cstdlib>

flang/unittests/Evaluate/testing.cpp renamed to flang/lib/Testing/testing.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
#include "testing.h"
1+
//===-- lib/Testing/testing.cpp ---------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "flang/Testing/testing.h"
210
#include "llvm/Support/raw_ostream.h"
311
#include <cstdarg>
412
#include <cstdio>

flang/runtime/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ add_definitions(-U_LIBCPP_ENABLE_ASSERTIONS)
111111
add_subdirectory(Float128Math)
112112

113113
set(sources
114-
${FLANG_SOURCE_DIR}/lib/Common/binary-to-decimal.cpp
115-
${FLANG_SOURCE_DIR}/lib/Common/decimal-to-binary.cpp
114+
${FLANG_SOURCE_DIR}/lib/Decimal/binary-to-decimal.cpp
115+
${FLANG_SOURCE_DIR}/lib/Decimal/decimal-to-binary.cpp
116116
ISO_Fortran_binding.cpp
117117
allocator-registry.cpp
118118
allocatable.cpp

flang/runtime/edit-input.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "format.h"
1313
#include "io-stmt.h"
14-
#include "flang/Common/decimal.h"
14+
#include "flang/Decimal/decimal.h"
1515

1616
namespace Fortran::runtime::io {
1717

flang/runtime/edit-output.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
#include "format.h"
2222
#include "io-stmt.h"
23-
#include "flang/Common/decimal.h"
2423
#include "flang/Common/uint128.h"
24+
#include "flang/Decimal/decimal.h"
2525

2626
namespace Fortran::runtime::io {
2727

flang/runtime/environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef FORTRAN_RUNTIME_ENVIRONMENT_H_
1010
#define FORTRAN_RUNTIME_ENVIRONMENT_H_
1111

12-
#include "flang/Common/decimal.h"
1312
#include "flang/Common/optional.h"
13+
#include "flang/Decimal/decimal.h"
1414

1515
struct EnvironmentDefaultList;
1616

flang/runtime/format-implementation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include "format.h"
1616
#include "io-stmt.h"
1717
#include "memory.h"
18-
#include "flang/Common/decimal.h"
1918
#include "flang/Common/format.h"
19+
#include "flang/Decimal/decimal.h"
2020
#include "flang/Runtime/main.h"
2121
#include <algorithm>
2222
#include <cstring>

flang/runtime/format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include "environment.h"
1515
#include "io-error.h"
1616
#include "flang/Common/Fortran-consts.h"
17-
#include "flang/Common/decimal.h"
1817
#include "flang/Common/optional.h"
18+
#include "flang/Decimal/decimal.h"
1919
#include "flang/Runtime/freestanding-tools.h"
2020
#include <cinttypes>
2121

flang/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ set(FLANG_TEST_DEPENDS
7272
llvm-readobj
7373
split-file
7474
flang_rt
75+
FortranDecimal
7576
)
7677
if (LLVM_ENABLE_PLUGINS AND NOT WIN32)
7778
list(APPEND FLANG_TEST_DEPENDS Bye)

flang/tools/bbc/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ target_link_libraries(bbc PRIVATE
3232
${extension_libs}
3333
MLIRAffineToStandard
3434
MLIRSCFToControlFlow
35-
FortranCommon
3635
FortranSupport
3736
FortranParser
3837
FortranEvaluate

0 commit comments

Comments
 (0)