diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-09-15 00:27:16 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-09-15 00:27:16 +0000 |
commit | 29edb15c5637738f3ac9c9d63003303127848204 (patch) | |
tree | 55191847f19102bcfd738acb455adb684fe3adce /gcc/testsuite/g++.dg/abi | |
parent | bd12da498dc86d4cb18b1f6548d1efb9f530172e (diff) | |
download | gcc-29edb15c5637738f3ac9c9d63003303127848204.zip gcc-29edb15c5637738f3ac9c9d63003303127848204.tar.gz gcc-29edb15c5637738f3ac9c9d63003303127848204.tar.bz2 |
class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for an bit-field whose width exceeds that of its...
* class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for
an bit-field whose width exceeds that of its type.
* g++.dg/abi/bitfield11.C: New test.
* g++.dg/abi/bitfield12.C: Likewise.
From-SVN: r71392
Diffstat (limited to 'gcc/testsuite/g++.dg/abi')
-rw-r--r-- | gcc/testsuite/g++.dg/abi/bitfield11.C | 14 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/bitfield12.C | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/bitfield11.C b/gcc/testsuite/g++.dg/abi/bitfield11.C new file mode 100644 index 0000000..e78ea12 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/bitfield11.C @@ -0,0 +1,14 @@ +// { dg-do run } +// { dg-options "-w -fabi-version=0" } + +struct S { + char c : 1024; +}; + +S s; + +int main () { + s.c = 1; + if (*(char *)&s != 1) + return 1; +} diff --git a/gcc/testsuite/g++.dg/abi/bitfield12.C b/gcc/testsuite/g++.dg/abi/bitfield12.C new file mode 100644 index 0000000..6cfda5d --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/bitfield12.C @@ -0,0 +1,5 @@ +// { dg-options "-Wabi -fabi-version=1" } + +struct S { // { dg-warning "ABI" } + char c : 1024; // { dg-warning "width" } +}; |