LCOV - code coverage report
Current view: top level - gcc/fortran - iso-c-binding.def (source / functions) Hit Total Coverage
Test: gcc.info Lines: 52 52 100.0 %
Date: 2020-03-28 11:57:23 Functions: 0 0 -
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* Copyright (C) 2006-2020 Free Software Foundation, Inc.
       2                 :            : 
       3                 :            : This file is part of GCC.
       4                 :            : 
       5                 :            : GCC is free software; you can redistribute it and/or modify it under
       6                 :            : the terms of the GNU General Public License as published by the Free
       7                 :            : Software Foundation; either version 3, or (at your option) any later
       8                 :            : version.
       9                 :            : 
      10                 :            : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      11                 :            : WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12                 :            : FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      13                 :            : for more details.
      14                 :            : 
      15                 :            : You should have received a copy of the GNU General Public License
      16                 :            : along with GCC; see the file COPYING3.  If not see
      17                 :            : <http://www.gnu.org/licenses/>.  */
      18                 :            : 
      19                 :            : /* This file contains the definition of the types provided by the
      20                 :            :    Fortran 2003 ISO_C_BINDING intrinsic module.  */
      21                 :            : 
      22                 :            : #ifndef NAMED_INTCST
      23                 :            : # define NAMED_INTCST(a,b,c,d) 
      24                 :            : #endif
      25                 :            : 
      26                 :            : #ifndef NAMED_REALCST
      27                 :            : # define NAMED_REALCST(a,b,c,d) 
      28                 :            : #endif
      29                 :            : 
      30                 :            : #ifndef NAMED_CMPXCST
      31                 :            : # define NAMED_CMPXCST(a,b,c,d) 
      32                 :            : #endif
      33                 :            : 
      34                 :            : #ifndef NAMED_LOGCST
      35                 :            : # define NAMED_LOGCST(a,b,c) 
      36                 :            : #endif
      37                 :            : 
      38                 :            : #ifndef NAMED_CHARKNDCST
      39                 :            : # define NAMED_CHARKNDCST(a,b,c) 
      40                 :            : #endif
      41                 :            : 
      42                 :            : #ifndef NAMED_FUNCTION
      43                 :            : # define NAMED_FUNCTION(a,b,c,d)
      44                 :            : #endif
      45                 :            : 
      46                 :            : #ifndef NAMED_SUBROUTINE
      47                 :            : # define NAMED_SUBROUTINE(a,b,c,d)
      48                 :            : #endif
      49                 :            : 
      50                 :            : /* The arguments to NAMED_*CST are:
      51                 :            :      -- an internal name
      52                 :            :      -- the symbol name in the module, as seen by Fortran code
      53                 :            :      -- the value it has, for use in trans-types.c  
      54                 :            :      -- the standard that supports this type  */
      55                 :            : 
      56                 :      65123 : NAMED_INTCST (ISOCBINDING_INT, "c_int", gfc_c_int_kind, GFC_STD_F2003)
      57                 :      64714 : NAMED_INTCST (ISOCBINDING_SHORT, "c_short", \
      58                 :            :               get_int_kind_from_node (short_integer_type_node), GFC_STD_F2003)
      59                 :      64714 : NAMED_INTCST (ISOCBINDING_LONG, "c_long", \
      60                 :            :               get_int_kind_from_node (long_integer_type_node), GFC_STD_F2003)
      61                 :      64714 : NAMED_INTCST (ISOCBINDING_LONG_LONG, "c_long_long", \
      62                 :            :               get_int_kind_from_node (long_long_integer_type_node), GFC_STD_F2003)
      63                 :            : 
      64                 :      64714 : NAMED_INTCST (ISOCBINDING_INTMAX_T, "c_intmax_t", \
      65                 :            :               get_int_kind_from_name (INTMAX_TYPE), GFC_STD_F2003)
      66                 :      64726 : NAMED_INTCST (ISOCBINDING_INTPTR_T, "c_intptr_t", \
      67                 :            :               get_int_kind_from_name (INTPTR_TYPE), GFC_STD_F2003)
      68                 :      27273 : NAMED_INTCST (ISOCBINDING_PTRDIFF_T, "c_ptrdiff_t", \
      69                 :            :               get_int_kind_from_name (PTRDIFF_TYPE), GFC_STD_F2018)
      70                 :      65013 : NAMED_INTCST (ISOCBINDING_SIZE_T, "c_size_t", \
      71                 :            :               gfc_index_integer_kind, GFC_STD_F2003)
      72                 :      64714 : NAMED_INTCST (ISOCBINDING_SIGNED_CHAR, "c_signed_char", \
      73                 :            :               get_int_kind_from_node (signed_char_type_node), GFC_STD_F2003)
      74                 :            : 
      75                 :      64714 : NAMED_INTCST (ISOCBINDING_INT8_T, "c_int8_t", \
      76                 :            :               get_int_kind_from_name (INT8_TYPE), GFC_STD_F2003)
      77                 :      64714 : NAMED_INTCST (ISOCBINDING_INT16_T, "c_int16_t", \
      78                 :            :               get_int_kind_from_name (INT16_TYPE), GFC_STD_F2003)
      79                 :      65878 : NAMED_INTCST (ISOCBINDING_INT32_T, "c_int32_t", \
      80                 :            :               get_int_kind_from_name (INT32_TYPE), GFC_STD_F2003)
      81                 :      65878 : NAMED_INTCST (ISOCBINDING_INT64_T, "c_int64_t", \
      82                 :            :               get_int_kind_from_name (INT64_TYPE), GFC_STD_F2003)
      83                 :            : /* GNU Extension.  */
      84                 :      27252 : NAMED_INTCST (ISOCBINDING_INT128_T, "c_int128_t", \
      85                 :            :               get_int_kind_from_width (128), GFC_STD_GNU)
      86                 :            : 
      87                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_LEAST8_T, "c_int_least8_t", \
      88                 :            :               get_int_kind_from_name (INT_LEAST8_TYPE), GFC_STD_F2003)
      89                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_LEAST16_T, "c_int_least16_t", \
      90                 :            :               get_int_kind_from_name (INT_LEAST16_TYPE), GFC_STD_F2003)
      91                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_LEAST32_T, "c_int_least32_t", \
      92                 :            :               get_int_kind_from_name (INT_LEAST32_TYPE), GFC_STD_F2003)
      93                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_LEAST64_T, "c_int_least64_t", \
      94                 :            :               get_int_kind_from_name (INT_LEAST64_TYPE), GFC_STD_F2003)
      95                 :            : /* GNU Extension.  */
      96                 :      27252 : NAMED_INTCST (ISOCBINDING_INT_LEAST128_T, "c_int_least128_t", \
      97                 :            :               get_int_kind_from_minimal_width (128), GFC_STD_GNU)
      98                 :            : 
      99                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_FAST8_T, "c_int_fast8_t", \
     100                 :            :               get_int_kind_from_name (INT_FAST8_TYPE), GFC_STD_F2003)
     101                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_FAST16_T, "c_int_fast16_t", \
     102                 :            :               get_int_kind_from_name (INT_FAST16_TYPE), GFC_STD_F2003)
     103                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_FAST32_T, "c_int_fast32_t", \
     104                 :            :               get_int_kind_from_name (INT_FAST32_TYPE), GFC_STD_F2003)
     105                 :      64714 : NAMED_INTCST (ISOCBINDING_INT_FAST64_T, "c_int_fast64_t", \
     106                 :            :               get_int_kind_from_name (INT_FAST64_TYPE), GFC_STD_F2003)
     107                 :            : /* GNU Extension.  */
     108                 :      27252 : NAMED_INTCST (ISOCBINDING_INT_FAST128_T, "c_int_fast128_t",
     109                 :            :               get_int_kind_from_width (128), GFC_STD_GNU)
     110                 :            : 
     111                 :      64720 : NAMED_REALCST (ISOCBINDING_FLOAT, "c_float", \
     112                 :            :                get_real_kind_from_node (float_type_node), GFC_STD_F2003)
     113                 :      64728 : NAMED_REALCST (ISOCBINDING_DOUBLE, "c_double", \
     114                 :            :                get_real_kind_from_node (double_type_node), GFC_STD_F2003)
     115                 :      64720 : NAMED_REALCST (ISOCBINDING_LONG_DOUBLE, "c_long_double", \
     116                 :            :                get_real_kind_from_node (long_double_type_node), GFC_STD_F2003)
     117                 :      64716 : NAMED_REALCST (ISOCBINDING_FLOAT128, "c_float128", \
     118                 :            :                gfc_float128_type_node == NULL_TREE \
     119                 :            :                   ? -4 : get_real_kind_from_node (gfc_float128_type_node), \
     120                 :            :                GFC_STD_GNU)
     121                 :      64720 : NAMED_CMPXCST (ISOCBINDING_FLOAT_COMPLEX, "c_float_complex", \
     122                 :            :                get_real_kind_from_node (float_type_node), GFC_STD_F2003)
     123                 :      64720 : NAMED_CMPXCST (ISOCBINDING_DOUBLE_COMPLEX, "c_double_complex", \
     124                 :            :                get_real_kind_from_node (double_type_node), GFC_STD_F2003)
     125                 :      64720 : NAMED_CMPXCST (ISOCBINDING_LONG_DOUBLE_COMPLEX, "c_long_double_complex", \
     126                 :            :                get_real_kind_from_node (long_double_type_node), GFC_STD_F2003)
     127                 :      64716 : NAMED_CMPXCST (ISOCBINDING_FLOAT128_COMPLEX, "c_float128_complex", \
     128                 :            :                gfc_float128_type_node == NULL_TREE \
     129                 :            :                   ? -4 : get_real_kind_from_node (gfc_float128_type_node), \
     130                 :            :                GFC_STD_GNU)
     131                 :            : 
     132                 :      63664 : NAMED_LOGCST (ISOCBINDING_BOOL, "c_bool", \
     133                 :            :               get_int_kind_from_width (BOOL_TYPE_SIZE))
     134                 :            : 
     135                 :      63664 : NAMED_CHARKNDCST (ISOCBINDING_CHAR, "c_char", gfc_default_character_kind)
     136                 :            : 
     137                 :            : #ifndef NAMED_CHARCST
     138                 :            : # define NAMED_CHARCST(a,b,c) 
     139                 :            : #endif
     140                 :            : 
     141                 :            : /* Use langhooks to deal with host to target translations.  */ 
     142                 :      33543 : NAMED_CHARCST (ISOCBINDING_NULL_CHAR, "c_null_char", \
     143                 :            :                lang_hooks.to_target_charset ('\0'))
     144                 :      33543 : NAMED_CHARCST (ISOCBINDING_ALERT, "c_alert", \
     145                 :            :                lang_hooks.to_target_charset ('\a'))
     146                 :      33543 : NAMED_CHARCST (ISOCBINDING_BACKSPACE, "c_backspace", \
     147                 :            :                lang_hooks.to_target_charset ('\b'))
     148                 :      33543 : NAMED_CHARCST (ISOCBINDING_FORM_FEED, "c_form_feed", \
     149                 :            :                lang_hooks.to_target_charset ('\f'))
     150                 :      33543 : NAMED_CHARCST (ISOCBINDING_NEW_LINE, "c_new_line", \
     151                 :            :                lang_hooks.to_target_charset ('\n'))
     152                 :      33543 : NAMED_CHARCST (ISOCBINDING_CARRIAGE_RETURN, "c_carriage_return", \
     153                 :            :                lang_hooks.to_target_charset ('\r'))
     154                 :      33543 : NAMED_CHARCST (ISOCBINDING_HORIZONTAL_TAB, "c_horizontal_tab", \
     155                 :            :                lang_hooks.to_target_charset ('\t'))
     156                 :      33543 : NAMED_CHARCST (ISOCBINDING_VERTICAL_TAB, "c_vertical_tab", \
     157                 :            :                lang_hooks.to_target_charset ('\v'))
     158                 :            : 
     159                 :            : #ifndef DERIVED_TYPE
     160                 :            : # define DERIVED_TYPE(a,b,c) 
     161                 :            : #endif
     162                 :            : 
     163                 :      25191 : DERIVED_TYPE (ISOCBINDING_PTR, "c_ptr", \
     164                 :            :               get_int_kind_from_node (ptr_type_node))
     165                 :      25191 : DERIVED_TYPE (ISOCBINDING_NULL_PTR, "c_null_ptr", \
     166                 :            :               get_int_kind_from_node (ptr_type_node))
     167                 :      25191 : DERIVED_TYPE (ISOCBINDING_FUNPTR, "c_funptr", \
     168                 :            :               get_int_kind_from_node (ptr_type_node))
     169                 :      25191 : DERIVED_TYPE (ISOCBINDING_NULL_FUNPTR, "c_null_funptr", \
     170                 :            :               get_int_kind_from_node (ptr_type_node))
     171                 :            : 
     172                 :            : /* The arguments to NAMED_FUNCTIONS and NAMED_SUBROUTINES are:
     173                 :            :      -- the ISYM
     174                 :            :      -- the symbol name in the module, as seen by Fortran code
     175                 :            :      -- the Fortran standard  */
     176                 :            : 
     177                 :      27377 : NAMED_SUBROUTINE (ISOCBINDING_F_POINTER, "c_f_pointer",
     178                 :            :                   GFC_ISYM_C_F_POINTER, GFC_STD_F2003)
     179                 :      27293 : NAMED_SUBROUTINE (ISOCBINDING_F_PROCPOINTER, "c_f_procpointer",
     180                 :            :                   GFC_ISYM_C_F_PROCPOINTER, GFC_STD_F2003)
     181                 :            : 
     182                 :      27379 : NAMED_FUNCTION (ISOCBINDING_ASSOCIATED, "c_associated",
     183                 :            :                 GFC_ISYM_C_ASSOCIATED, GFC_STD_F2003)
     184                 :      27345 : NAMED_FUNCTION (ISOCBINDING_FUNLOC, "c_funloc",
     185                 :            :                 GFC_ISYM_C_FUNLOC, GFC_STD_F2003)
     186                 :      27411 : NAMED_FUNCTION (ISOCBINDING_LOC, "c_loc",
     187                 :            :                 GFC_ISYM_C_LOC, GFC_STD_F2003)
     188                 :            : 
     189                 :      27329 : NAMED_FUNCTION (ISOCBINDING_C_SIZEOF, "c_sizeof", \
     190                 :            :                 GFC_ISYM_C_SIZEOF, GFC_STD_F2008)
     191                 :            : 
     192                 :            : #undef NAMED_INTCST
     193                 :            : #undef NAMED_REALCST
     194                 :            : #undef NAMED_CMPXCST
     195                 :            : #undef NAMED_LOGCST
     196                 :            : #undef NAMED_CHARCST
     197                 :            : #undef NAMED_CHARKNDCST
     198                 :            : #undef DERIVED_TYPE
     199                 :            : #undef NAMED_FUNCTION
     200                 :            : #undef NAMED_SUBROUTINE

Generated by: LCOV version 1.0

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto --enable-host-shared. GCC test suite is run with the built compiler.