Skip to content

Commit dfe9895

Browse files
committed
Fix scalar unit tests for all, any, maxloc, etc. that caused the ARM build
to fail due to warnings as errors. Note that I could not reproduce the problem locally, but based on the messages, I think this change will fix the errors. Differential Revision: https://reviews.llvm.org/D107120
1 parent da6626d commit dfe9895

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

flang/unittests/RuntimeGTest/Reduction.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ TEST(Reductions, DoubleMaxMinNorm2) {
150150
// A scalar result occurs when you have a rank 1 array and dim == 1.
151151
std::vector<int> shape1{24};
152152
auto array1{MakeArray<TypeCategory::Real, 8>(shape1, rawData)};
153-
StaticDescriptor<0, true> statDesc0;
154-
Descriptor &scalarResult{statDesc0.descriptor()};
153+
StaticDescriptor<1, true> statDesc0[1];
154+
Descriptor &scalarResult{statDesc0[0].descriptor()};
155155
RTNAME(MaxlocDim)
156156
(scalarResult, *array1, /*KIND=*/2, /*DIM=*/1, __FILE__, __LINE__,
157157
/*MASK=*/nullptr, /*BACK=*/false);
@@ -302,8 +302,8 @@ TEST(Reductions, Logical) {
302302
std::vector<int> shape1{4};
303303
auto array1{MakeArray<TypeCategory::Logical, 4>(
304304
shape1, std::vector<std::int32_t>{false, false, true, true})};
305-
StaticDescriptor<0, true> statDesc0;
306-
Descriptor &scalarResult{statDesc0.descriptor()};
305+
StaticDescriptor<1, true> statDesc0[1];
306+
Descriptor &scalarResult{statDesc0[0].descriptor()};
307307
RTNAME(AllDim)(scalarResult, *array1, /*DIM=*/1, __FILE__, __LINE__);
308308
EXPECT_EQ(scalarResult.rank(), 0);
309309
EXPECT_EQ(*scalarResult.ZeroBasedIndexedElement<std::int32_t>(0), 0);
@@ -501,8 +501,8 @@ TEST(Reductions, FindlocNumeric) {
501501
std::vector<double>{0.0, -0.0, 1.0, 3.14,
502502
std::numeric_limits<double>::quiet_NaN(),
503503
std::numeric_limits<double>::infinity()})};
504-
StaticDescriptor<0, true> statDesc0;
505-
Descriptor &scalarResult{statDesc0.descriptor()};
504+
StaticDescriptor<1, true> statDesc0[1];
505+
Descriptor &scalarResult{statDesc0[0].descriptor()};
506506
RTNAME(FindlocDim)
507507
(scalarResult, *realArray1, target, 8, /*DIM=*/1, __FILE__, __LINE__, nullptr,
508508
/*BACK=*/false);

0 commit comments

Comments
 (0)