CMakeFortranCompilerABI.F 1.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
      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]'
13 14
#elif defined(__x86_64__)
        PRINT *, 'INFO:sizeof_dptr[8]'
15 16 17 18 19

#elif defined(_ILP32)
        PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(_M_IX86)
        PRINT *, 'INFO:sizeof_dptr[4]'
20 21
#elif defined(__i386__)
        PRINT *, 'INFO:sizeof_dptr[4]'
22 23 24 25 26

#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
        PRINT *, 'INFO:sizeof_dptr[4]'
27 28 29 30
#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]'
31 32 33 34 35
#endif

#if 0
! Application Binary Interface
#endif
36
#if defined(__ELF__)
37 38 39
        PRINT *, 'INFO:abi[ELF]'
#endif
        PRINT *, 'ABI Detection'
40
      END