AArch64: correct constraint on Upl early clobber alternatives
[official-gcc.git] / gcc / testsuite / gfortran.dg / ISO_Fortran_binding_11.c
blobe013011a38070759c8503e4c499190aeb1ffa8b4
1 /* Test the fix of PR89846.
3 Contributed by Reinhold Bader <Bader@lrz.de>#include <stdio.h> */
5 #include <stdlib.h>
6 #include <stddef.h>
7 #include <stdio.h>
8 #include <ISO_Fortran_binding.h>
10 typedef struct
12 char n;
13 float r[2];
14 } t1;
16 typedef struct
18 long int i;
19 t1 t1;
20 } t2;
24 void ta0(CFI_cdesc_t *);
25 void ta1(CFI_cdesc_t *);
27 void ti(CFI_cdesc_t *this, int flag)
29 int status;
30 size_t dis;
31 CFI_CDESC_T(1) that;
32 t1 *ans;
34 switch (flag)
36 case 0:
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);
43 exit(1);
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);
49 exit(1);
51 break;
53 case 1:
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);
60 exit(1);
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);
66 exit(1);
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);