Hi Jakub,
is this revised patch ok now?
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/703939.html
Given lack of hardware, I have no way of testing the offload_device
version, though.
Thanks.
Rainer
>>> + { dg-output-file target-cdtor-2.output { xfail *-*-solaris2* } }
>>
>> This looks wrong to me, the original dg-output has different effective
>> targets, but there is just one output file, so it will either fail
>> for offload_device, or fail without that.
>
> drats, I just blindly copied the Linux output into *.output, ignoring
> the offload_device cases ;-(
>
> Here's what I've done now: I use two output files, one without target
> offload_device (xfail'ed on Solaris), one with it. The offload_device
> file doesn't need to care about Solaris: this case will never happen.
>
> AFAICS we don't have to worry about different newline conventions:
> dg-output-file resp. gcc-dg.exp's ${tool}_load use gets to read the
> file, which discards newlines. I'm uncertain if there can be multiple
> newlines, though, which are allowed by the original patterns.
>
> Here's the revised patch:
>
> ---------------------------------------------------------------------------
>
> The libgomp.c++/target-cdtor-2.C test FAILs on Solaris:
>
> FAIL: libgomp.c++/target-cdtor-2.C output pattern test
>
> Compared to the Linux output
>
> ~S, 5, 1
> [...]
> finiDH1, 1
>
> the Solaris output has a different order:
>
> finiDH1, 1
> [...]
> ~S, 5, 1
>
> This is another instance of the long-standing PR c++/81337. As detailed
> there, the relative order of ~S::S() and __attribute__((destructor()))
> functions isn't guaranteed. Since xfail'ing the dg-output parts isn't
> practical, this patch switches the test to using dg-output-file. One
> file is used in the ! offload_device case, the other for offload_device.
>
> Tested on i386-pc-solaris2.11, x86_64-pc-linux-gnu, and
> x86_64-apple-darwin25.1.0 (unsupported since there's no init_priority
> support).
>
> Ok for trunk?
>
> Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University