From d4bbc157af2e72767c87fa522fea128fe9bf00f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Pr=C3=B6tel?= Date: Sat, 24 Feb 2024 16:24:30 +0100 Subject: [PATCH] Fixed more expected files. --- regression-tests/pure2-intro-example-three-loops.cpp2 | 7 ++++++- .../test-results/gcc-10/pure2-new-basics.cpp.execution | 0 .../test-results/gcc-10/pure2-new-basics.cpp.output | 0 regression-tests/test-results/mixed-type-safety-1.cpp | 2 +- .../test-results/pure2-intro-example-three-loops.cpp | 9 +++++++-- 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 regression-tests/test-results/gcc-10/pure2-new-basics.cpp.execution create mode 100644 regression-tests/test-results/gcc-10/pure2-new-basics.cpp.output diff --git a/regression-tests/pure2-intro-example-three-loops.cpp2 b/regression-tests/pure2-intro-example-three-loops.cpp2 index aa51ea9599..6a7e951774 100644 --- a/regression-tests/pure2-intro-example-three-loops.cpp2 +++ b/regression-tests/pure2-intro-example-three-loops.cpp2 @@ -12,7 +12,12 @@ main: () -> int = { ( "hello", "big", "world" ); view: std::span = words; - i := new(0); + p_i := new(0); + if (!p_i) { + return 1; + } + i := p_i*; + while i* < view.ssize() next i*++ { print( view[i*] ); } diff --git a/regression-tests/test-results/gcc-10/pure2-new-basics.cpp.execution b/regression-tests/test-results/gcc-10/pure2-new-basics.cpp.execution new file mode 100644 index 0000000000..e69de29bb2 diff --git a/regression-tests/test-results/gcc-10/pure2-new-basics.cpp.output b/regression-tests/test-results/gcc-10/pure2-new-basics.cpp.output new file mode 100644 index 0000000000..e69de29bb2 diff --git a/regression-tests/test-results/mixed-type-safety-1.cpp b/regression-tests/test-results/mixed-type-safety-1.cpp index 42805efca6..fa69bb4418 100644 --- a/regression-tests/test-results/mixed-type-safety-1.cpp +++ b/regression-tests/test-results/mixed-type-safety-1.cpp @@ -58,7 +58,7 @@ auto print(cpp2::in msg, cpp2::in b) -> void print( "1 is int? ", cpp2::is(1)); auto c {cpp2_new()}; // safe by construction - Shape* s {CPP2_UFCS(get)(std::move(c))}; // safe by Lifetime + Shape* s {CPP2_UFCS(get)((*cpp2::assert_not_null(std::move(c))))}; // safe by Lifetime print("\ns* is Shape? ", cpp2::is(*cpp2::assert_not_null(s))); print( "s* is Circle? ", cpp2::is(*cpp2::assert_not_null(s))); print( "s* is Square? ", cpp2::is(*cpp2::assert_not_null(std::move(s)))); diff --git a/regression-tests/test-results/pure2-intro-example-three-loops.cpp b/regression-tests/test-results/pure2-intro-example-three-loops.cpp index 5ad0a40d26..0f06d9b905 100644 --- a/regression-tests/test-results/pure2-intro-example-three-loops.cpp +++ b/regression-tests/test-results/pure2-intro-example-three-loops.cpp @@ -21,7 +21,7 @@ auto decorate_and_print(auto& thing) -> void; #line 10 "pure2-intro-example-three-loops.cpp2" [[nodiscard]] auto main() -> int; -#line 30 "pure2-intro-example-three-loops.cpp2" +#line 35 "pure2-intro-example-three-loops.cpp2" #line 1 "pure2-intro-example-three-loops.cpp2" @@ -45,7 +45,12 @@ auto decorate_and_print(auto& thing) -> void{ "hello", "big", "world"}; std::span view {words}; - auto i {cpp2_new(0)}; + auto p_i {cpp2_new(0)}; + if ((!(p_i))) { + return 1; + } + auto i {*cpp2::assert_not_null(std::move(p_i))}; + for( ; cpp2::cmp_less(*cpp2::assert_not_null(i),CPP2_UFCS(ssize)(view)); ++*cpp2::assert_not_null(i) ) { print(CPP2_ASSERT_IN_BOUNDS(view, *cpp2::assert_not_null(i))); }