Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/typecodes-scalar-int128-c.c

raw
1 #include <stdlib.h>
2 #include <stdint.h>
3 #include <stdio.h>
4 #include <string.h>
5
6 #include <ISO_Fortran_binding.h>
7 #include "dump-descriptors.h"
8
9 extern void ctest (CFI_cdesc_t *arg_int128,
10 CFI_cdesc_t *arg_least128,
11 CFI_cdesc_t *arg_fast128);
12
13 /* Sanity check the type info in the descriptor a. */
14
15 static void
16 check (CFI_cdesc_t *a, size_t size, int typecode)
17 {
18 dump_CFI_cdesc_t (a);
19 if (a->attribute != CFI_attribute_pointer)
20 abort ();
21 if (a->base_addr != NULL)
22 abort ();
23 if (a->rank != 0)
24 abort ();
25 if (size && a->elem_len != size)
26 abort ();
27 if (a->type != typecode)
28 abort ();
29 }
30
31 void
32 ctest (CFI_cdesc_t *arg_int128,
33 CFI_cdesc_t *arg_least128,
34 CFI_cdesc_t *arg_fast128)
35 {
36 check (arg_int128, sizeof (__int128), CFI_type_int128_t);
37 check (arg_least128, sizeof (__int128), CFI_type_int_least128_t);
38 check (arg_fast128, sizeof (__int128), CFI_type_int_fast128_t);
39 }
40
41