1 /* Verify that predefined macros for properties of the compiler and 2 library together are the same before and after system headers are 3 included. This is broken with older glibc versions. */ 4 /* { dg-do compile } */ 5 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ 6 7 #ifdef __STDC_IEC_559__ 8 #define IEC_559_DEFINED_BEFORE 1 9 #else 10 #define IEC_559_DEFINED_BEFORE 0 11 #endif 12 13 #ifdef __STDC_IEC_559_COMPLEX__ 14 #define IEC_559_COMPLEX_DEFINED_BEFORE 1 15 #else 16 #define IEC_559_COMPLEX_DEFINED_BEFORE 0 17 #endif 18 19 #ifdef __STDC_ISO_10646__ 20 #define ISO_10646_DEFINED_BEFORE 1 21 #else 22 #define ISO_10646_DEFINED_BEFORE 0 23 #endif 24 25 #include <stdio.h> 26 27 #ifdef __STDC_IEC_559__ 28 #define IEC_559_DEFINED_AFTER 1 29 #else 30 #define IEC_559_DEFINED_AFTER 0 31 #endif 32 33 #ifdef __STDC_IEC_559_COMPLEX__ 34 #define IEC_559_COMPLEX_DEFINED_AFTER 1 35 #else 36 #define IEC_559_COMPLEX_DEFINED_AFTER 0 37 #endif 38 39 #ifdef __STDC_ISO_10646__ 40 #define ISO_10646_DEFINED_AFTER 1 41 #else 42 #define ISO_10646_DEFINED_AFTER 0 43 #endif 44 45 #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) 46 #define BROKEN 47 #endif 48 49 #ifndef BROKEN 50 51 #if IEC_559_DEFINED_BEFORE != IEC_559_DEFINED_AFTER 52 #error "__STDC_IEC_559__ definition inconsistency" 53 #endif 54 55 #if IEC_559_COMPLEX_DEFINED_BEFORE != IEC_559_COMPLEX_DEFINED_AFTER 56 #error "__STDC_IEC_559_COMPLEX__ definition inconsistency" 57 #endif 58 59 #if ISO_10646_DEFINED_BEFORE != ISO_10646_DEFINED_AFTER 60 #error "__STDC_ISO_10646__ definition inconsistency" 61 #endif 62 63 #endif 64