Attempt to fix g++.dg tests failures in gnu-versioned-namespace mode

François Dumont frs.dumont@gmail.com
Thu Sep 21 05:01:09 GMT 2023


Thanks for the feedback, seems a little bit too complicated for what I'm 
trying to achieve.

I'm eventually testing this patch which is also how libstdc++ is 
managing this small problem.

I'll submit a proper patch once confirmed that tests are fixed.

François

On 20/09/2023 09:22, Thomas Schwinge wrote:
> Hi!
>
> On 2023-09-20T07:08:25+0200, François Dumont via Gcc <gcc@gcc.gnu.org> wrote:
>> I've configured libstdc++ with --enable-symvers=gnu-versioned-namespace
> I can't comment on that option...
>
>> and run make check-c++.
>>
>> A number of failures are like this one:
>>
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:
>> In function 'coro1 f()':
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:9:1:
>> error: 'operator new' is provided by
>> 'std::__8::__n4861::__coroutine_traits_impl<coro1, void>::promise_type'
>> {aka 'co
>> ro1::promise_type'} but is not usable with the function signature 'coro1
>> f()'
>> compiler exited with status 1
>> FAIL: g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C  (test for
>> errors, line 9)
>> FAIL: g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C (test for excess
>> errors)
>> Excess errors:
>> /home/fdumont/dev/gcc/git/gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-00-bad-op-new.C:9:1:
>> error: 'operator new' is provided by
>> 'std::__n4861::__coroutine_traits_impl<coro1, void>::promise_type' {aka
>> 'coro1::promise_type'} but is not usable with the function signature
>> 'coro1 f()'
>>
>> The '__8' is messing with expected output.
>>
>> So I've added:
>>
>>       # Ignore optional version namespace from libstdc++.
>>       regsub -all "std::__8::" $text "std::" text
> ..., and whether that's conceptually the correct solution...
>
>> in testsuite/lib/prune.exp prune_gcc_output.
>>
>> But it had no impact, same failures.
>>
>> What am I missing ?
> ..., but I can answer that one: pruning happens after scanning for
> 'dg-error' etc. (..., which are captured in 'dg-messages').  See DejaGnu
> 'dg.exp:dg-test':
>
>      [...]
>          set results [${tool}-dg-test $prog [lindex ${dg-do-what} 0] "$tool_flags ${dg-extra-tool-flags}"]
>
>          set comp_output [lindex $results 0]
>          set output_file [lindex $results 1]
>
>          foreach i ${dg-messages} {
>              verbose "Scanning for message: $i" 4
>
>              # Remove all error messages for the line [lindex $i 0]
>              # in the source file.  If we find any, success!
>      [...]
>          }
>
>          # Remove messages from the tool that we can ignore.
>          set comp_output [prune_warnings $comp_output]
>      [...]
>              if {$comp_output ne ""} {
>                  fail "$name (test for excess errors)"
>                  send_log "Excess errors:\n$comp_output\n"
>              } else {
>                  pass "$name (test for excess errors)"
>              }
>      [...]
>
> So you'll have to have your 's%std::__8::%std::' work on 'dg-messages', I
> suppose?
>
>
> Grüße
>   Thomas
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc_testsuite.patch
Type: text/x-patch
Size: 4808 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20230921/c16f5ea4/attachment.bin>


More information about the Gcc mailing list