1  #include <stdlib.h>
       2  /* interopse with myftype_1 */
       3  typedef struct {
       4     signed char chr;
       5     signed char chr2;
       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  
      14  int main(int argc, char **argv)
      15  {
      16     myctype_t *cchr;
      17     asm("":"=r"(cchr):"0"(&myVar));
      18     cchr->chr = 1;
      19     cchr->chr2 = 2;
      20  
      21     types_test();
      22  
      23     if(cchr->chr != 2)
      24        abort();
      25     if(cchr->chr2 != 2)
      26        abort();
      27     myVar.chr2 = 3;
      28     types_test();
      29  
      30     if(myVar.chr != 3)
      31        abort();
      32     if(myVar.chr2 != 3)
      33        abort();
      34     return 0;
      35  }
      36