From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2AC50385DC0A; Fri, 1 Sep 2023 16:55:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AC50385DC0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693587356; bh=dLC7jyQaYBHHNgKo9oon6hrwQl7RzsrNnBEwZE3zojQ=; h=From:To:Subject:Date:From; b=v2tP134DpLTAvUiinGpvJJ1fmEBN8SNnBld0ASzFdNW/7CXLHVRE/ClO7dExHlx9y h6HGu6TBykKfjibh0QIKMgK0Kbk3rez4mMLOxOdp1YYmArno2wMHhMQhiITQdCfhP7 pK9uh1Ys+ZVtCLBjGj7r0Wb0jXxjxOlXa3JzyftE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-3630] libstdc++: Fix debug-mode tests for constexpr algorithms X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: e3d25188b093c3b8552f2b3e3a33c2a6059e3ad6 X-Git-Newrev: b0d75f7d3bb24e94c5a3d764c95d598ad6b6ca48 Message-Id: <20230901165556.2AC50385DC0A@sourceware.org> Date: Fri, 1 Sep 2023 16:55:56 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b0d75f7d3bb24e94c5a3d764c95d598ad6b6ca48 commit r14-3630-gb0d75f7d3bb24e94c5a3d764c95d598ad6b6ca48 Author: Jonathan Wakely Date: Fri Sep 1 17:06:51 2023 +0100 libstdc++: Fix debug-mode tests for constexpr algorithms These tests started failing at some point: FAIL: 25_algorithms/copy/debug/constexpr_neg.cc (test for errors, line 49) FAIL: 25_algorithms/copy/debug/constexpr_neg.cc (test for excess errors) FAIL: 25_algorithms/equal/debug/constexpr_neg.cc (test for errors, line 47) FAIL: 25_algorithms/equal/debug/constexpr_neg.cc (test for excess errors) They only run with -D_GLIBCXX_DEBUG or make check-debug so seem to have gone unnoticed until now. libstdc++-v3/ChangeLog: * testsuite/25_algorithms/copy/debug/constexpr_neg.cc: Adjust expected errors. * testsuite/25_algorithms/equal/debug/constexpr_neg.cc: Likewise. Diff: --- .../testsuite/25_algorithms/copy/debug/constexpr_neg.cc | 8 +++----- .../testsuite/25_algorithms/equal/debug/constexpr_neg.cc | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/debug/constexpr_neg.cc b/libstdc++-v3/testsuite/25_algorithms/copy/debug/constexpr_neg.cc index 6981c4706661..bf3c4939bfb7 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy/debug/constexpr_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy/debug/constexpr_neg.cc @@ -34,6 +34,7 @@ test1() } static_assert(test1()); // { dg-error "non-constant condition" } +// { dg-error "builtin_unreachable" "" { target *-*-* } 0 } constexpr bool test2() @@ -46,8 +47,5 @@ test2() return out6 == ma0.begin() + 18; } -static_assert(test2()); // { dg-error "is outside the bounds" } - -// { dg-prune-output "in 'constexpr' expansion" } -// { dg-prune-output "builtin_unreachable" } -// { dg-prune-output "non-constant condition" } +static_assert(test2()); // { dg-error "non-constant condition" } +// { dg-error "is outside the bounds" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/25_algorithms/equal/debug/constexpr_neg.cc b/libstdc++-v3/testsuite/25_algorithms/equal/debug/constexpr_neg.cc index bb613bef03b4..f5e46e58e496 100644 --- a/libstdc++-v3/testsuite/25_algorithms/equal/debug/constexpr_neg.cc +++ b/libstdc++-v3/testsuite/25_algorithms/equal/debug/constexpr_neg.cc @@ -32,7 +32,8 @@ test01() return outa; } -static_assert(test01()); // { dg-error } +static_assert(test01()); // { dg-error "non-constant condition" } +// { dg-error "builtin_unreachable" "" { target *-*-* } 0 } constexpr bool test02() @@ -44,8 +45,5 @@ test02() return outa; } -static_assert(test02()); // { dg-error "outside the bounds" } - -// { dg-prune-output "non-constant condition" } -// { dg-prune-output "in 'constexpr'" } -// { dg-prune-output "builtin_unreachable" } +static_assert(test02()); // { dg-error "non-constant condition" } +// { dg-error "is outside the bounds" "" { target *-*-* } 0 }