756 :" "compiler_version[" COMPILER_VERSION "]";
757
758/* Construct a string literal encoding the version number components. */
759#elif defined(COMPILER_VERSION_MAJOR)
760char const info_version[] = {
761 'I', 'N', 'F', 'O', ':',
762 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
763 COMPILER_VERSION_MAJOR,
764# ifdef COMPILER_VERSION_MINOR
765 '.', COMPILER_VERSION_MINOR,
766# ifdef COMPILER_VERSION_PATCH
767 '.', COMPILER_VERSION_PATCH,
768# ifdef COMPILER_VERSION_TWEAK
769 '.', COMPILER_VERSION_TWEAK,
770# endif
771# endif
772# endif
773 ']','\0'};
774#endif
775
776/* Construct a string literal encoding the internal version number. */
777#ifdef COMPILER_VERSION_INTERNAL
778char const info_version_internal[] = {
779 'I', 'N', 'F', 'O', ':',
780 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
781 'i','n','t','e','r','n','a','l','[',
782 COMPILER_VERSION_INTERNAL,']','\0'};
783#elif defined(COMPILER_VERSION_INTERNAL_STR)
784char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
785#endif
786
787/* Construct a string literal encoding the version number components. */
788#ifdef SIMULATE_VERSION_MAJOR
789char const info_simulate_version[] = {
790 'I', 'N', 'F', 'O', ':',
791 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
792 SIMULATE_VERSION_MAJOR,
793# ifdef SIMULATE_VERSION_MINOR
794 '.', SIMULATE_VERSION_MINOR,
795# ifdef SIMULATE_VERSION_PATCH
796 '.', SIMULATE_VERSION_PATCH,
797# ifdef SIMULATE_VERSION_TWEAK
798 '.', SIMULATE_VERSION_TWEAK,
799# endif
800# endif
801# endif
802 ']','\0'};
803#endif
804
805/* Construct the string literal in pieces to prevent the source from
806 getting matched. Store it in a pointer rather than an array
807 because some compilers will just produce instructions to fill the
808 array rather than assigning a pointer to a static array. */
809char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
810char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
811
812
813
814#if !defined(__STDC__) && !defined(__clang__)
815# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
816# define C_VERSION "90"
817# else
818# define C_VERSION
819# endif
820#elif __STDC_VERSION__ > 201710L
821# define C_VERSION "23"
822#elif __STDC_VERSION__ >= 201710L
823# define C_VERSION "17"
824#elif __STDC_VERSION__ >= 201000L
825# define C_VERSION "11"
826#elif __STDC_VERSION__ >= 199901L
827# define C_VERSION "99"
828#else
829# define C_VERSION "90"
830#endif
831const char* info_language_standard_default =
832 "INFO" ":" "standard_default[" C_VERSION "]";
833
834const char* info_language_extensions_default = "INFO" ":" "extensions_default["
835#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
836 defined(__TI_COMPILER_VERSION__)) && \
837 !defined(__STRICT_ANSI__)
838 "ON"
839#else
840 "OFF"
841#endif
842"]";
843
844/*--------------------------------------------------------------------------*/
845
846#ifdef ID_VOID_MAIN
847void main() {}
848#else
849# if defined(__CLASSIC_C__)
850int main(argc, argv) int argc; char *argv[];
851# else
852int main(int argc, char* argv[])
853# endif
854{
855 int require = 0;
856 require += info_compiler[argc];
857 require += info_platform[argc];
858 require += info_arch[argc];
859#ifdef COMPILER_VERSION_MAJOR
860 require += info_version[argc];
861#endif
862#ifdef COMPILER_VERSION_INTERNAL
863 require += info_version_internal[argc];
864#endif
865#ifdef SIMULATE_ID
866 require += info_simulate[argc];
867#endif
868#ifdef SIMULATE_VERSION_MAJOR
869 require += info_simulate_version[argc];
870#endif
871#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
872 require += info_cray[argc];
873#endif
874 require += info_language_standard_default[argc];
875 require += info_language_extensions_default[argc];
876 (void)argv;
877 return require;
878}
879#endif