diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-09-19 17:48:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-09-19 17:48:42 +0200 |
commit | d2f53a601a23925b795ac162f7936163c3461b2c (patch) | |
tree | d7b04372f64aca63a035fcce287eac35bc59b49f /gcc | |
parent | 1560cc94e8a6c309a74d0a1a24820087e149733b (diff) | |
download | gcc-d2f53a601a23925b795ac162f7936163c3461b2c.zip gcc-d2f53a601a23925b795ac162f7936163c3461b2c.tar.gz gcc-d2f53a601a23925b795ac162f7936163c3461b2c.tar.bz2 |
testsuite work-around compound-assignment-1.c C++ failures on various targets [PR111377]
On Mon, Sep 11, 2023 at 11:11:30PM +0200, Jakub Jelinek via Gcc-patches wrote:
> I think the divergence is whether called_by_test_5b returns the struct
> in registers or in memory. If in memory (like in the x86_64 -m32 case), we have
> [compound-assignment-1.c:71:21] D.3191 = called_by_test_5b (); [return slot optimization]
> [compound-assignment-1.c:71:21 discrim 1] D.3191 ={v} {CLOBBER(eol)};
> [compound-assignment-1.c:72:1] return;
> in the IL, while if in registers (like x86_64 -m64 case), just
> [compound-assignment-1.c:71:21] D.3591 = called_by_test_5b ();
> [compound-assignment-1.c:72:1] return;
>
> If you just want to avoid the differences, putting } on the same line as the
> call might be a usable workaround for that.
Here is the workaround in patch form.
2023-09-19 Jakub Jelinek <jakub@redhat.com>
PR testsuite/111377
* c-c++-common/analyzer/compound-assignment-1.c (test_5b): Move
closing } to the same line as the call to work-around differences in
diagnostics line.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c b/gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c index 0ab006d..b7389e2 100644 --- a/gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c +++ b/gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c @@ -68,5 +68,8 @@ called_by_test_5b (void) void test_5b (void) { - called_by_test_5b (); -} /* { dg-warning "leak of '<anonymous>.ptr_wrapper::ptr'" "" { target c++ } } */ + called_by_test_5b (); } +/* { dg-warning "leak of '<anonymous>.ptr_wrapper::ptr'" "" { target c++ } .-1 } */ +/* The closing } above is intentionally on the same line as the call, because + otherwise the exact line of the diagnostics depends on whether the + called_by_test_5b () call satisfies aggregate_value_p or not. */ |