X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-alignof.c;h=a8b6d18996f0c2d1ad573ea4cbe2a11bad7e315f;hb=e016983c7406fb8aa0c750053425ffb3cbaeec4a;hp=851cbf0924c0880ce64819e9973558f81cbbabf2;hpb=610a9cc95c2a1c9c0260ea7d0f9a850c6c017828;p=gnulib.git diff --git a/tests/test-alignof.c b/tests/test-alignof.c index 851cbf092..a8b6d1899 100644 --- a/tests/test-alignof.c +++ b/tests/test-alignof.c @@ -1,5 +1,5 @@ /* Test of . - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,9 +21,11 @@ #include #include +#include #include "verify.h" +typedef long double longdouble; typedef struct { char a[1]; } struct1; typedef struct { char a[2]; } struct2; typedef struct { char a[3]; } struct3; @@ -31,7 +33,9 @@ typedef struct { char a[4]; } struct4; #define CHECK(type) \ typedef struct { char slot1; type slot2; } type##_helper; \ - verify (alignof (type) == offsetof (type##_helper, slot2)); + verify (alignof_slot (type) == offsetof (type##_helper, slot2)); \ + const int type##_slot_alignment = alignof_slot (type); \ + const int type##_type_alignment = alignof_type (type); CHECK (char) CHECK (short) @@ -39,6 +43,10 @@ CHECK (int) CHECK (long) CHECK (float) CHECK (double) +CHECK (longdouble) +#ifdef INT64_MAX +CHECK (int64_t) +#endif CHECK (struct1) CHECK (struct2) CHECK (struct3)