summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pack-test-5.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-20 22:01:58 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-20 22:01:58 +0000
commit244b1c60bab6c63d71fc88969398ad1c8422c826 (patch)
tree99702060f929b5c08f13fc9befcb764c656bce2e /gcc/testsuite/gcc.dg/pack-test-5.c
parenta708df987b189f39eb220de75c9b4c9b19b2fd28 (diff)
downloadgcc-244b1c60bab6c63d71fc88969398ad1c8422c826.tar.gz
PR c/11446
* stor-layout.c (layout_decl): Fix alignment handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pack-test-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/pack-test-5.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pack-test-5.c b/gcc/testsuite/gcc.dg/pack-test-5.c
new file mode 100644
index 00000000000..e95030c089e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pack-test-5.c
@@ -0,0 +1,19 @@
+/* PR c/11446: packed on a struct takes precedence over aligned on the type
+ of a field. */
+/* { dg-do run } */
+
+struct A {
+ double d;
+} __attribute__ ((aligned));
+
+struct B {
+ char c;
+ struct A a;
+} __attribute__ ((packed));
+
+int main ()
+{
+ if (sizeof (struct B) != sizeof (char) + sizeof (struct A))
+ abort ();
+ return 0;
+}