]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.dg/pragma-align.c: New test.
authorRobert Lipe <robertl@sco.com>
Mon, 11 Sep 2000 18:38:14 +0000 (18:38 +0000)
committerRobert Lipe <robertl@gcc.gnu.org>
Mon, 11 Sep 2000 18:38:14 +0000 (18:38 +0000)
From-SVN: r36323

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pragma-align.c [new file with mode: 0644]

index fdd07e07193027d3895d652fd1d7f727f9d76818..3fbaaa09bfd7735873dc1260966535c3cc3da2c0 100644 (file)
@@ -1,3 +1,7 @@
+2000-09-11  Robert Lipe  <robertl@sco.com>
+       
+       * gcc.dg/pragma-align.c: New test.
+
 2000-09-11  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.pt/explicit82.C: New test.
diff --git a/gcc/testsuite/gcc.dg/pragma-align.c b/gcc/testsuite/gcc.dg/pragma-align.c
new file mode 100644 (file)
index 0000000..3848f77
--- /dev/null
@@ -0,0 +1,41 @@
+/* Prove that HANDLE_SYSTEMV_PRAGMA alignment handling works somewhat. */
+
+/* { dg-do compile { target i?86-*-linux* i?86-*-*bsd* i?86-*-sco3.2v5* } } */
+
+struct {
+        char one;
+        long two;
+} defaultalign;
+
+#pragma pack(4)
+struct {
+        char one;
+        long two;
+} sixteen;
+
+#pragma pack(1)
+struct {
+        char one;
+        long two;
+} two;
+
+#pragma pack(2)
+struct {
+        char one;
+        long two;
+} three;
+
+#pragma pack()
+struct {
+        char one;
+        long two;
+} resetalign;
+
+main()
+{
+        if(sizeof(sixteen) < sizeof(defaultalign)) abort();
+        if(sizeof(two) >= sizeof(defaultalign)) abort();
+        if(sizeof(three) <= sizeof(two)) abort();
+        if(sizeof(resetalign) != sizeof(defaultalign)) abort();
+}
+