1 /* Test the fix of PR89846.
3 Contributed by Reinhold Bader <Bader@lrz.de>#include <stdio.h> */
8 #include <ISO_Fortran_binding.h>
24 void ta0(CFI_cdesc_t
*);
25 void ta1(CFI_cdesc_t
*);
27 void ti(CFI_cdesc_t
*this, int flag
)
37 dis
= offsetof(t2
, t1
);
38 status
= CFI_establish((CFI_cdesc_t
*) &that
, NULL
, CFI_attribute_other
,
39 CFI_type_struct
, sizeof(t1
), 1, NULL
);
40 if (status
!= CFI_SUCCESS
)
42 printf("FAIL 1 establish: nonzero status %i\n",status
);
45 status
= CFI_select_part((CFI_cdesc_t
*) &that
, this, dis
, 0);
46 if (status
!= CFI_SUCCESS
)
48 printf("FAIL C1: nonzero status %i\n",status
);
54 dis
= offsetof(t2
, i
);
55 status
= CFI_establish((CFI_cdesc_t
*) &that
, NULL
, CFI_attribute_other
,
56 CFI_type_long
, 0, 1, NULL
);
57 if (status
!= CFI_SUCCESS
)
59 printf("FAIL 2 establish: nonzero status %i\n",status
);
62 status
= CFI_select_part((CFI_cdesc_t
*) &that
, this, dis
, 0);
63 if (status
!= CFI_SUCCESS
)
65 printf("FAIL C2: nonzero status %i\n",status
);
70 if (CFI_is_contiguous((CFI_cdesc_t
*) &that
))
72 printf("FAIL C: contiguity for flag value %i - is %i\n",flag
,
73 CFI_is_contiguous((CFI_cdesc_t
*) &that
));
76 if (flag
== 0) ta0((CFI_cdesc_t
*) &that
);
77 if (flag
== 1) ta1((CFI_cdesc_t
*) &that
);