diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/abi/align1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/abi/align1.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/align1.C b/gcc/testsuite/g++.dg/abi/align1.C new file mode 100644 index 000000000..2a70bce60 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/align1.C @@ -0,0 +1,27 @@ +// This was failuring on powerpc-darwin and powerpc-aix as +// we were taking the embeded type as the first field decl. +// This was PR target/18761. +// { dg-do run } + + +union A { + double d; +}; +union B { + enum E { e }; + double d; +}; +struct AlignA { + char c; + A a; +}; +struct AlignB { + char c; + B b; +}; +extern "C" void abort (); +int main () { + if ( __alignof__ (AlignA) != __alignof__ (AlignB)) + abort (); +} + |