Skip to content

Commit 51f0bb8

Browse files
author
Kevin Egan
committed
Changes in regression-tests adding _for_break variable (#1436)
1 parent e5f3f97 commit 51f0bb8

8 files changed

+15
-15
lines changed

regression-tests/test-results/mixed-bounds-safety-with-assert-2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ auto add_42_to_subrange(auto& rng, cpp2::impl::in<int> start, cpp2::impl::in<int
4646
auto count {0};
4747
for (
4848

49-
auto& i : rng ) { do
49+
auto& i : rng ) { bool _for_break = false; do
5050
if ([_0 = start, _1 = count, _2 = end]{ return cpp2::impl::cmp_less_eq(_0,_1) && cpp2::impl::cmp_less_eq(_1,_2); }()) {
5151
i += 42;
52-
} while (false); ++count; }
52+
} while (false); if (_for_break) { break; } ++count; }
5353
}
5454

regression-tests/test-results/mixed-bounds-safety-with-assert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ auto print_subrange(auto const& rng, cpp2::impl::in<int> start, cpp2::impl::in<i
4444
auto count {0};
4545
for (
4646

47-
auto const& i : rng ) { do
47+
auto const& i : rng ) { bool _for_break = false; do
4848
if (cpp2::impl::cmp_less_eq(start,count) && cpp2::impl::cmp_less_eq(count,end)) {
4949
std::cout << i << "\n";
50-
} while (false); ++count; }
50+
} while (false); if (_for_break) { break; } ++count; }
5151
}
5252

regression-tests/test-results/mixed-intro-for-with-counter-include-last.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
{
3131
std::vector<int> v {1, 2, 3, 4, 5};
3232
auto counter {42};
33-
for ( auto const& i : cpp2::move(v) ) { do {
33+
for ( auto const& i : cpp2::move(v) ) { bool _for_break = false; do {
3434
std::cout << i << " " << counter << "\n";
35-
} while (false); counter *= 2; }
35+
} while (false); if (_for_break) { break; } counter *= 2; }
3636
}
3737

regression-tests/test-results/pure2-autodiff-higher-order.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ std::vector<cpp2::taylor<double,6>> v_d {};
972972
r = 0.0;
973973
{
974974
auto t_d_iter{CPP2_UFCS(begin)(cpp2::move(v_d))};
975-
for ( auto const& t : cpp2::move(v) ) { do {
975+
for ( auto const& t : cpp2::move(v) ) { bool _for_break = false; do {
976976
{
977977
auto const& t_d{*cpp2::impl::assert_not_null(t_d_iter)};
978978
{
@@ -981,7 +981,7 @@ auto const& t_d{*cpp2::impl::assert_not_null(t_d_iter)};
981981
}
982982
}
983983
}
984-
while (false); (++t_d_iter); }
984+
while (false); if (_for_break) { break; } (++t_d_iter); }
985985
}
986986
return { std::move(r), std::move(r_d) };
987987
}

regression-tests/test-results/pure2-autodiff.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ std::vector<double> v_d {};
11861186
r = 0.0;
11871187
{
11881188
auto t_d_iter{CPP2_UFCS(begin)(cpp2::move(v_d))};
1189-
for ( auto const& t : cpp2::move(v) ) { do {
1189+
for ( auto const& t : cpp2::move(v) ) { bool _for_break = false; do {
11901190
{
11911191
auto const& t_d{*cpp2::impl::assert_not_null(t_d_iter)};
11921192
{
@@ -1195,7 +1195,7 @@ auto const& t_d{*cpp2::impl::assert_not_null(t_d_iter)};
11951195
}
11961196
}
11971197
}
1198-
while (false); (++t_d_iter); }
1198+
while (false); if (_for_break) { break; } (++t_d_iter); }
11991199
}
12001200
return { std::move(r), std::move(r_d) };
12011201
}

regression-tests/test-results/pure2-for-loop-range-with-lambda.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ auto main(int const argc_, char** argv_) -> int{
5050

5151
for ( auto const& i : [_0 = args]() mutable -> decltype(auto) { return _0; }() ) static_cast<void>(i);
5252
for ( auto const& j : [](auto&& x) -> decltype(auto) { return CPP2_FORWARD(x); }(args) ) static_cast<void>(j);
53-
for ( auto const& k : [](auto&& x) -> decltype(auto) { return CPP2_FORWARD(x); }(args) ) { do static_cast<void>(k); while (false); static_cast<void>([_0 = args]() mutable -> decltype(auto) { return _0; }()); }
54-
for ( auto const& l : [](auto&& x) -> decltype(auto) { return CPP2_FORWARD(x); }(args) ) { do static_cast<void>(l); while (false); static_cast<void>([](auto&& x) -> decltype(auto) { return x; }(args)); }
53+
for ( auto const& k : [](auto&& x) -> decltype(auto) { return CPP2_FORWARD(x); }(args) ) { bool _for_break = false; do static_cast<void>(k); while (false); if (_for_break) { break; } static_cast<void>([_0 = args]() mutable -> decltype(auto) { return _0; }()); }
54+
for ( auto const& l : [](auto&& x) -> decltype(auto) { return CPP2_FORWARD(x); }(args) ) { bool _for_break = false; do static_cast<void>(l); while (false); if (_for_break) { break; } static_cast<void>([](auto&& x) -> decltype(auto) { return x; }(args)); }
5555
}
5656

regression-tests/test-results/pure2-last-use.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,8 +1393,8 @@ auto loops() -> void{
13931393
auto x {cpp2_new<int>(0)};
13941394
for (
13951395

1396-
[[maybe_unused]] auto const& unnamed_param_1 : { 0 } ) { do
1397-
{} while (false); f_inout(x); }
1396+
[[maybe_unused]] auto const& unnamed_param_1 : { 0 } ) { bool _for_break = false; do
1397+
{} while (false); if (_for_break) { break; } f_inout(x); }
13981398
});
13991399

14001400
static_cast<void>([]() -> void{

regression-tests/test-results/pure2-print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ requires (true) inline CPP2_CONSTEXPR T outer::object_alias{ 42 };
140140

141141
do {} while ( [&]{ b() ; return true; }() && CPP2_UFCS(empty)(s));
142142

143-
for ( [[maybe_unused]] auto const& unnamed_param_1 : m ) { { do {goto CONTINUE_label; } while (false); c(); } CPP2_CONTINUE_BREAK(label) }
143+
for ( [[maybe_unused]] auto const& unnamed_param_1 : m ) { { bool _for_break = false; do {goto CONTINUE_label; } while (false); if (_for_break) { break; } c(); } CPP2_CONTINUE_BREAK(label) }
144144

145145
#line 47 "pure2-print.cpp2"
146146
if (cpp2::impl::is(!(CPP2_UFCS(empty)(s)), (true))) {cpp2::move(a)(); }

0 commit comments

Comments
 (0)