OSDN Git Service

2005-01-11 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jan 2005 20:19:35 +0000 (20:19 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jan 2005 20:19:35 +0000 (20:19 +0000)
        PR target/18761
        * g++.dg/abi/align1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93194 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/align1.C [new file with mode: 0644]

index a280105..f74ab33 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-11  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR target/18761
+       * g++.dg/abi/align1.C: New test.
+
 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
 
        * g++.dg/ext/altivec-3.C (baz, baz2): Check one component of structs
diff --git a/gcc/testsuite/g++.dg/abi/align1.C b/gcc/testsuite/g++.dg/abi/align1.C
new file mode 100644 (file)
index 0000000..2a70bce
--- /dev/null
@@ -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 ();
+}
+