1 #include <stdlib.h> 2 /* interopse with myftype_1 */ 3 typedef struct { 4 float *ptr; 5 int *ptr2; 6 } myctype_t; 7 8 9 extern void abort(void); 10 void types_test(void); 11 /* declared in the fortran module */ 12 extern myctype_t myVar; 13 main(int argc,char ** argv)14int main(int argc, char **argv) 15 { 16 myctype_t *cptr; 17 asm("":"=r"(cptr):"0"(&myVar)); 18 cptr->ptr = (float *)(size_t) (void *)1; 19 cptr->ptr2 = (int *)(size_t) (void *)2; 20 21 types_test(); 22 23 if(cptr->ptr != (float *)(size_t) (void *)2) 24 abort(); 25 if(cptr->ptr2 != (int *)(size_t) (void *)2) 26 abort(); 27 myVar.ptr2 = (int *)(size_t) (void *)3; 28 types_test(); 29 30 if(myVar.ptr != (float *)(size_t) (void *)3) 31 abort(); 32 if(myVar.ptr2 != (int *)(size_t) (void *)3) 33 abort(); 34 return 0; 35 } 36 37