Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/typecodes-array-float128-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_float128,
10 CFI_cdesc_t *arg_complex128);
11
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_other)
20 abort ();
21 if (a->base_addr == NULL)
22 abort ();
23 if (a->rank != 1)
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_float128,
33 CFI_cdesc_t *arg_complex128)
34 {
35 check (arg_float128, sizeof (_Float128), CFI_type_float128);
36 check (arg_complex128, sizeof (_Float128) * 2,
37 CFI_type_float128_Complex);
38 }