From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.old-deja/g++.abi/align.C | 125 +++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.abi/align.C (limited to 'gcc/testsuite/g++.old-deja/g++.abi/align.C') diff --git a/gcc/testsuite/g++.old-deja/g++.abi/align.C b/gcc/testsuite/g++.old-deja/g++.abi/align.C new file mode 100644 index 000000000..037add32c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.abi/align.C @@ -0,0 +1,125 @@ +// { dg-do run { target i?86-*-linux* x86_64-*-linux* i?86-*-freebsd* i?86-*-darwin* } } +// { dg-require-effective-target ilp32 } +// { dg-options "-malign-double" } +// Origin: Alex Samuel + +/* Test the size and alignment of fundamental C types for compliance + with the IA-64 ABI. */ + +template +inline unsigned +alignmentof () +{ + struct S + { + char start_; + T object_; + }; + + return (unsigned) & ((S *) 0)->object_; +} + +/* Computes the alignment, in bytes, of TYPE. */ + +#define alignof(type) (alignmentof ()) + +enum A { a }; + +int +main () +{ + if (sizeof (char) != 1) + return 1; + if (alignof (char) != 1) + return 2; + if (sizeof (signed char) != 1) + return 3; + if (alignof (signed char) != 1) + return 4; + if (sizeof (unsigned char) != 1) + return 5; + if (alignof (unsigned char) != 1) + return 6; + if (sizeof (short) != 2) + return 7; + if (alignof (short) != 2) + return 8; + if (sizeof (signed short) != 2) + return 9; + if (alignof (signed short) != 2) + return 10; + if (sizeof (unsigned short) != 2) + return 11; + if (alignof (unsigned short) != 2) + return 12; + if (sizeof (int) != 4) + return 13; + if (alignof (int) != 4) + return 14; + if (sizeof (signed int) != 4) + return 15; + if (alignof (signed int) != 4) + return 16; + if (sizeof (unsigned int) != 4) + return 17; + if (alignof (unsigned int) != 4) + return 18; + if (sizeof (enum A) != 4) + return 19; + if (alignof (enum A) != 4) + return 20; +#ifdef HAVE_IA64_TYPES + if (sizeof (__int64) != 8) + return 21; + if (alignof (__int64) != 8) + return 22; + if (sizeof (signed __int64) != 8) + return 23; + if (alignof (signed ___int64) != 8) + return 24; + if (sizeof (unsigned __int64) != 8) + return 25; + if (alignof (unsigned __int64) != 8) + return 26; + if (sizeof (__int128) != 16) + return 27; + if (alignof (__int128) != 16) + return 28; + if (sizeof (signed __int128) != 16) + return 29; + if (alignof (signed ___int128) != 16) + return 30; + if (sizeof (unsigned __int128) != 16) + return 31; + if (alignof (unsigned ___int128) != 16) + return 32; +#endif /* HAVE_IA64_TYPES */ + if (sizeof (void *) != 4) + return 33; + if (alignof (void *) != 4) + return 34; + if (sizeof (void (*) ()) != 4) + return 35; + if (alignof (void (*) ()) != 4) + return 36; + if (sizeof (float) != 4) + return 37; + if (alignof (float) != 4) + return 38; + if (sizeof (double) != 8) + return 39; + if (alignof (double) != 8) + return 40; +#ifdef HAVE_IA64_TYPES + if (sizeof (__float80) != 16) + return 41; + if (alignof (__float80) != 16) + return 42; + if (sizeof (__float128) != 16) + return 43; + if (alignof (__float128) != 16) + return 44; +#endif /* HAVE_IA64_TYPES */ + + return 0; +} -- cgit v1.2.3