| 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 |
/* Sanity check the type info in the descriptor a. */ |
| 13 |
|
| 14 |
static void |
| 15 |
check (CFI_cdesc_t *a, size_t size, int typecode) |
| 16 |
{ |
| 17 |
dump_CFI_cdesc_t (a); |
| 18 |
if (a->attribute != CFI_attribute_pointer) |
| 19 |
abort (); |
| 20 |
if (a->base_addr != NULL) |
| 21 |
abort (); |
| 22 |
if (a->rank != 0) |
| 23 |
abort (); |
| 24 |
if (size && a->elem_len != size) |
| 25 |
abort (); |
| 26 |
if (a->type != typecode) |
| 27 |
abort (); |
| 28 |
} |
| 29 |
|
| 30 |
void |
| 31 |
ctest (CFI_cdesc_t *arg_float128, |
| 32 |
CFI_cdesc_t *arg_complex128) |
| 33 |
{ |
| 34 |
check (arg_float128, sizeof (_Float128), CFI_type_float128); |
| 35 |
check (arg_complex128, sizeof (_Float128) * 2, |
| 36 |
CFI_type_float128_Complex); |
| 37 |
} |
| 38 |
|