diff mbox

[testsuite] : g++.dg/abi

Message ID CAEwic4Zbg0uoN5yDag3Xn3i44isNw7EJEtKV0hTKxkNhFeSgPA@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz March 18, 2014, 1:16 p.m. UTC
Hi,

this patch skips anon2.C and anon3.C test for mingw target.  Issue
here is that weak under pe-coff is different to ELF-targets and
therefore test doesn't apply for

FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N11D1C3fn1ENS0_1BE
FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N11D1C3fn2ES1_
FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N31D1CIiE3fn1ENS0_1BE
FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N31D1CIiE3fn2ES2_
FAIL: g++.dg/abi/anon2.C -std=c++1y  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N11D1C3fn1ENS0_1BE
FAIL: g++.dg/abi/anon2.C -std=c++1y  scan-assembler
.weak(_definition)?[ \t]_?_ZN2N11D1C3fn2ES1_
...

ChangeLog

2014-03-18  Kai Tietz  <ktietz@redhat.com>

        * g++.dg/abi/anon2.C: Skip for mingw targets.
        * g++.dg/abi/anon3.C: Likewise.

Tested for x86_64-unknown-linux-gnu, and i686-w64-mingw32.  Ok for apply?

Regards,
Kai

\t\]_?_ZN4Heya4blahEv" } }

Comments

Mike Stump March 19, 2014, 4:23 p.m. UTC | #1
On Mar 18, 2014, at 6:16 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> this patch skips anon2.C and anon3.C test for mingw target.  Issue
> here is that weak under pe-coff is different to ELF-targets and
> therefore test doesn't apply for

So, what does the output look like?  There should be a trace of weak of some sort in the output.
Kai Tietz March 19, 2014, 4:38 p.m. UTC | #2
2014-03-19 17:23 GMT+01:00 Mike Stump <mikestump@comcast.net>:
> On Mar 18, 2014, at 6:16 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> this patch skips anon2.C and anon3.C test for mingw target.  Issue
>> here is that weak under pe-coff is different to ELF-targets and
>> therefore test doesn't apply for
>
> So, what does the output look like?  There should be a trace of weak of some sort in the output.

No, there is none.  Output looks like:

        .seh_proc       _ZN2N43._91CIiE3fn2ES2_
_ZN2N43._91CIiE3fn2ES2_:
.LFB11:
        .seh_endprologue
        ret
        .seh_endproc
        .globl  _ZN2N41qE
        .data
        .align 8
_ZN2N41qE:
        .quad   _ZN2N43._91CIiE3fn2ES2_
        .globl  _ZN2N41pE
        .align 8
_ZN2N41pE:
        .quad   _ZN2N43._91CIiE3fn1ENS0_1BE
        .globl  _ZN2N31qE
        .align 8
_ZN2N31qE:
        .quad   _ZN2N31D1CIiE3fn2ES2_...

The concept of weak - as present in ELF - isn't known in COFF in
general.  There is some weak, but it works only for static library and
in a limitted way.  Therefore we can't (and don't) use it for COFF
targets.

Kai

PS: I have another similiar reasoned patch for g++.dg/abi/thunk5.C on
my pile too.
Rainer Orth March 19, 2014, 4:49 p.m. UTC | #3
Kai Tietz <ktietz70@googlemail.com> writes:

> 2014-03-19 17:23 GMT+01:00 Mike Stump <mikestump@comcast.net>:
>> On Mar 18, 2014, at 6:16 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>> this patch skips anon2.C and anon3.C test for mingw target.  Issue
>>> here is that weak under pe-coff is different to ELF-targets and
>>> therefore test doesn't apply for
>>
>> So, what does the output look like?  There should be a trace of weak of
>> some sort in the output.
>
> No, there is none.  Output looks like:
>
>         .seh_proc       _ZN2N43._91CIiE3fn2ES2_
> _ZN2N43._91CIiE3fn2ES2_:
> .LFB11:
>         .seh_endprologue
>         ret
>         .seh_endproc
>         .globl  _ZN2N41qE
>         .data
>         .align 8
> _ZN2N41qE:
>         .quad   _ZN2N43._91CIiE3fn2ES2_
>         .globl  _ZN2N41pE
>         .align 8
> _ZN2N41pE:
>         .quad   _ZN2N43._91CIiE3fn1ENS0_1BE
>         .globl  _ZN2N31qE
>         .align 8
> _ZN2N31qE:
>         .quad   _ZN2N31D1CIiE3fn2ES2_...
>
> The concept of weak - as present in ELF - isn't known in COFF in
> general.  There is some weak, but it works only for static library and
> in a limitted way.  Therefore we can't (and don't) use it for COFF
> targets.

In that case, it seems far better to have
gcc/testsuite/lib/target-support.exp (check_weak_available) reflect that
instead of lying about weak support.

This way, everything else simply falls into place; no need to
special-case many individual testcases.

	Rainer
Mike Stump March 19, 2014, 4:51 p.m. UTC | #4
On Mar 19, 2014, at 9:38 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2014-03-19 17:23 GMT+01:00 Mike Stump <mikestump@comcast.net>:
>> On Mar 18, 2014, at 6:16 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>> this patch skips anon2.C and anon3.C test for mingw target.  Issue
>>> here is that weak under pe-coff is different to ELF-targets and
>>> therefore test doesn't apply for
>> 
>> So, what does the output look like?  There should be a trace of weak of some sort in the output.
> 
> No, there is none.

So, does the target support weak?
Mike Stump March 19, 2014, 4:54 p.m. UTC | #5
On Mar 19, 2014, at 9:49 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>> The concept of weak - as present in ELF - isn't known in COFF in
>> general.  There is some weak, but it works only for static library and
>> in a limitted way.  Therefore we can't (and don't) use it for COFF
>> targets.
> 
> In that case, it seems far better to have
> gcc/testsuite/lib/target-support.exp (check_weak_available) reflect that
> instead of lying about weak support.

Yeah, this is the direction I was headed…  :-)
Kai Tietz March 19, 2014, 4:59 p.m. UTC | #6
2014-03-19 17:54 GMT+01:00 Mike Stump <mikestump@comcast.net>:
> On Mar 19, 2014, at 9:49 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>>> The concept of weak - as present in ELF - isn't known in COFF in
>>> general.  There is some weak, but it works only for static library and
>>> in a limitted way.  Therefore we can't (and don't) use it for COFF
>>> targets.
>>
>> In that case, it seems far better to have
>> gcc/testsuite/lib/target-support.exp (check_weak_available) reflect that
>> instead of lying about weak support.
>
> Yeah, this is the direction I was headed...  :-)

Ok, I will sent a patch for changing target-support.exp.

And yes, target supports a kind of weak, but not the expected gnu-weak.

Thanks,
Kai
Joseph Myers March 19, 2014, 5:37 p.m. UTC | #7
On Wed, 19 Mar 2014, Kai Tietz wrote:

> The concept of weak - as present in ELF - isn't known in COFF in
> general.  There is some weak, but it works only for static library and
> in a limitted way.  Therefore we can't (and don't) use it for COFF
> targets.

There are already two different checks (check_weak_available and 
check_weak_override_available), reflecting what different testcases need.  
Is the requirement for these tests logically different from both of those?  
If so, maybe there should be a third such check (even if in fact it does 
the same thing as check_weak_override_available).
Kai Tietz March 19, 2014, 5:47 p.m. UTC | #8
2014-03-19 18:37 GMT+01:00 Joseph S. Myers <joseph@codesourcery.com>:
> On Wed, 19 Mar 2014, Kai Tietz wrote:
>
>> The concept of weak - as present in ELF - isn't known in COFF in
>> general.  There is some weak, but it works only for static library and
>> in a limitted way.  Therefore we can't (and don't) use it for COFF
>> targets.
>
> There are already two different checks (check_weak_available and
> check_weak_override_available), reflecting what different testcases need.
> Is the requirement for these tests logically different from both of those?
> If so, maybe there should be a third such check (even if in fact it does
> the same thing as check_weak_override_available).
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

On a second thought the disabling of weak-available for mingw-targets
seems to be wrong.  Actually weak is present.  It just has a different
meaning.
Those testcases are - AFAIU them - actually checking that weaks are
available. Nevertheless the check here intends to probe if
weak-override is possible.  As otherwise weaks make no sense here
AFAICS.
I don't think that we need to add a third check here. It might be
enough to check for weak-override-available instead for those tests.

Kai
Jeff Law April 4, 2014, 1:29 p.m. UTC | #9
On 03/18/14 07:16, Kai Tietz wrote:
> Hi,
>
> this patch skips anon2.C and anon3.C test for mingw target.  Issue
> here is that weak under pe-coff is different to ELF-targets and
> therefore test doesn't apply for
>
> FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N11D1C3fn1ENS0_1BE
> FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N11D1C3fn2ES1_
> FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N31D1CIiE3fn1ENS0_1BE
> FAIL: g++.dg/abi/anon2.C -std=c++11  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N31D1CIiE3fn2ES2_
> FAIL: g++.dg/abi/anon2.C -std=c++1y  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N11D1C3fn1ENS0_1BE
> FAIL: g++.dg/abi/anon2.C -std=c++1y  scan-assembler
> .weak(_definition)?[ \t]_?_ZN2N11D1C3fn2ES1_
> ...
>
> ChangeLog
>
> 2014-03-18  Kai Tietz  <ktietz@redhat.com>
>
>          * g++.dg/abi/anon2.C: Skip for mingw targets.
>          * g++.dg/abi/anon3.C: Likewise.
>
> Tested for x86_64-unknown-linux-gnu, and i686-w64-mingw32.  Ok for apply?
Yes.  This is fine.

Sorry for the delay.

Jeff
diff mbox

Patch

Index: anon2.C
===================================================================
--- anon2.C     (Revision 208594)
+++ anon2.C     (Arbeitskopie)
@@ -1,5 +1,6 @@ 
 // PR c++/55877
 // { dg-require-weak "" }
+// { dg-skip-if "requires unsupported weak in pe-coff" { *-*-mingw* } }

 namespace N1 {
   typedef struct {
Index: anon3.C
===================================================================
--- anon3.C     (Revision 208594)
+++ anon3.C     (Arbeitskopie)
@@ -1,4 +1,5 @@ 
 // { dg-require-weak "" }
+// { dg-skip-if "requires unsupported weak in pe-coff" { *-*-mingw* } }

 typedef struct {
   // { dg-final { scan-assembler ".weak\(_definition\)?\[