CMake/Modules/CMakeFortranCompilerABI.F
Brad King eb8cb2c6c2 Fortran: Detect pointer size on Intel archs with PGI (#14870)
The PGI compiler does not define __SIZEOF_POINTER__ so use the
__x86_64__ or __i386__ CPU macros to select a pointer size instead.
2014-04-10 12:57:02 -04:00

47 lines
1.3 KiB
Fortran

PROGRAM CMakeFortranCompilerABI
#if 0
! Address Size
#endif
#if defined(_LP64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_IA64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_X64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_AMD64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__x86_64__)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_ILP32)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(_M_IX86)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__i386__)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 4
PRINT *, 'INFO:sizeof_dptr[4]'
#endif
#if 0
! Application Binary Interface
#endif
#if defined(__sgi) && defined(_ABIO32)
PRINT *, 'INFO:abi[ELF O32]'
#elif defined(__sgi) && defined(_ABIN32)
PRINT *, 'INFO:abi[ELF N32]'
#elif defined(__sgi) && defined(_ABI64)
PRINT *, 'INFO:abi[ELF 64]'
#elif defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
PRINT *, 'ABI Detection'
END