OSDN Git Service

* gcc.c-torture/execute/991118-1.c: New test.
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Nov 1999 07:56:12 +0000 (07:56 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Nov 1999 07:56:12 +0000 (07:56 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30570 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/991118-1.c [new file with mode: 0644]

index eef72d6..5a05f13 100644 (file)
@@ -1,3 +1,7 @@
+1999-11-18 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+       * gcc.c-torture/execute/991118-1.c: New test.
+
 1999-11-16  Geoffrey Keating  <geoffk@cygnus.com>
 
        * g77.f-torture/execute/u77-test.f (wd): Allow for longer
diff --git a/gcc/testsuite/gcc.c-torture/execute/991118-1.c b/gcc/testsuite/gcc.c-torture/execute/991118-1.c
new file mode 100644 (file)
index 0000000..ea769af
--- /dev/null
@@ -0,0 +1,45 @@
+struct tmp
+{
+  long long int pad : 12;
+  long long int field : 52;
+};
+
+struct tmp2
+{
+  long long int field : 52;
+  long long int pad : 12;
+};
+
+struct tmp
+sub (struct tmp tmp)
+{
+  tmp.field ^= 0x0008765412345678LL;
+  return tmp;
+}
+
+struct tmp2
+sub2 (struct tmp2 tmp2)
+{
+  tmp2.field ^= 0x0008765412345678LL;
+  return tmp2;
+}
+
+struct tmp tmp = {0x123, 0x123456789ABCDLL};
+struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123};
+
+main()
+{
+
+  if (sizeof (long long) != 8)
+    exit (0);
+
+  tmp = sub (tmp);
+  tmp2 = sub2 (tmp2);
+
+  if (tmp.pad != 0x123 || tmp.field != 0xFFF9551175BDFDB5LL)
+    abort ();
+  if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL)
+    abort ();
+  exit (0);
+}
+