diff mbox

[testsuite,g++.dg] : Reflect ABI change for windows native targets about bitfield layout in structures

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

Commit Message

Kai Tietz Dec. 15, 2011, 10:33 a.m. UTC
2011/12/15 Rainer Orth <ro@cebitec.uni-bielefeld.de>:
> Kai Tietz <ktietz70@googlemail.com> writes:
>
>> Index: g++.dg/abi/bitfield3.C
>> ===================================================================
>> --- g++.dg/abi/bitfield3.C    (revision 182092)
>> +++ g++.dg/abi/bitfield3.C    (working copy)
>> @@ -3,7 +3,7 @@
>>  // { dg-options "-O2" }
>>  // Cygwin and mingw32 default to MASK_ALIGN_DOUBLE. Override to ensure
>>  // 4-byte alignment.
>> -// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } }
>> +// { dg-options "-mno-align-double -mno-ms-bitfields" { target
>> i?86-*-cygwin* i?86-*-mingw* } }
>
> The comment only explains the -mno-align-double now.  Would you please
> add an explanation for -mno-ms-bitfields, too?
>
> Thanks.
>        Rainer

Fine, so patch looks now like that.

Kai

 {

Comments

Dave Korn Dec. 15, 2011, 4:51 p.m. UTC | #1
On 15/12/2011 10:33, Kai Tietz wrote:

> -// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } }
> +// As for mingw target the the ms-bitfield switch is activated by default,
> +// make sure for this test that it is disabled.
> +// { dg-options "-mno-align-double -mno-ms-bitfields" { target i?86-*-cygwin* i
> ?86-*-mingw* } }

  We don't use ms-bitfields on Cygwin, so I guess it wouldn't be expected to
do any harm anyway, but rather than setting the same options for both wouldn't
it be possible to do:

{ dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } }
{ dg-additional-options "-mno-ms-bitfields" { target i?86-*-mingw* } }

... so that MinGW gets both and Cygwin only the one it wants?  (Actually the
first one could just as well be changed to dg-additional-options at the same
time, couldn't it?)

    cheers,
      DaveK
diff mbox

Patch

Index: bitfield3.C
===================================================================
--- bitfield3.C (revision 182092)
+++ bitfield3.C (working copy)
@@ -1,9 +1,11 @@ 
 // Test for oversized bitfield alignment in structs on IA-32
 // { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
 // { dg-options "-O2" }
-// Cygwin and mingw32 default to MASK_ALIGN_DOUBLE. Override to ensure
+// Cygwin and mingw default to MASK_ALIGN_DOUBLE. Override to ensure
 // 4-byte alignment.
-// { dg-options "-mno-align-double" { target i?86-*-cygwin* i?86-*-mingw* } }
+// As for mingw target the the ms-bitfield switch is activated by default,
+// make sure for this test that it is disabled.
+// { dg-options "-mno-align-double -mno-ms-bitfields" { target i?86-*-cygwin* i
?86-*-mingw* } }

 struct A