annotate gcc/testsuite/gcc.dg/pack-test-5.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/11446: packed on a struct takes precedence over aligned on the type
kono
parents:
diff changeset
2 of a field. */
kono
parents:
diff changeset
3 /* { dg-do run } */
kono
parents:
diff changeset
4 /* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 extern void abort (void);
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct A {
kono
parents:
diff changeset
9 double d;
kono
parents:
diff changeset
10 } __attribute__ ((aligned));
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 struct B {
kono
parents:
diff changeset
13 char c;
kono
parents:
diff changeset
14 struct A a;
kono
parents:
diff changeset
15 } __attribute__ ((packed));
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 int main ()
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 if (sizeof (struct B) != sizeof (char) + sizeof (struct A))
kono
parents:
diff changeset
20 abort ();
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }