Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/typecodes-array-int128.f90

raw
1 ! PR 101305
2 ! { dg-do run }
3 ! { dg-require-effective-target fortran_integer_16 }
4 ! { dg-additional-sources "typecodes-array-int128-c.c dump-descriptors.c" }
5 ! { dg-additional-options "-g" }
6 !
7 ! This program tests that 128-bit integer kind constants provided by
8 ! gfortran's ISO_C_BINDING module result in the right type field in
9 ! arguments passed by descriptor, also matching the size of the corresponding
10 ! C type. We use assumed-shape arrays to force the use of a descriptor.
11
12 program testit
13 use iso_c_binding
14 implicit none
15
16 interface
17
18 subroutine ctest (arg_int128, arg_least128, arg_fast128) bind (c)
19 use iso_c_binding
20 integer(C_INT128_T) :: arg_int128(:)
21 integer(C_INT_LEAST128_T) :: arg_least128(:)
22 integer(C_INT_FAST128_T) :: arg_fast128(:)
23 end subroutine
24
25 end interface
26
27 integer(C_INT128_T) :: var_int128(4)
28 integer(C_INT_LEAST128_T) :: var_least128(4)
29 integer(C_INT_FAST128_T) :: var_fast128(4)
30
31 call ctest (var_int128, var_least128, var_fast128)
32
33 end program