From: Herman A.J. ten Brugge Date: Thu, 18 Nov 1999 07:56:12 +0000 (+0100) Subject: * gcc.c-torture/execute/991118-1.c: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee7602056eb3f0156d9c6b5eb2a8c9e1402997d2;p=gcc.git * gcc.c-torture/execute/991118-1.c: New test. From-SVN: r30570 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eef72d6a97e..5a05f13023d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +1999-11-18 Herman A.J. ten Brugge + + * gcc.c-torture/execute/991118-1.c: New test. + 1999-11-16 Geoffrey Keating * 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 index 00000000000..ea769afc86f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/991118-1.c @@ -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); +} +