#include <perms.h>

//          Edinburgh IMP77 Compiler - Version 8.4
//
//     1  %recordformat Commfm(%integer i, j, k)

struct COMMFM {
  union {
    struct {
      int I;
      int J;
      int K;
    };
  };
};

//     2
//     3  %externalroutine PASS2(%record(Commfm)%name Interface)

void PASS2(struct COMMFM *INTERFACE) {
  _imp_enter(PASS2);

  //     4
  //     5     ! If the procedure below is removed, the Interface_k = 23 statement translates OK!
  //     6
  //     7     %routine Initialise

  void INITIALISE(void) {
    _imp_enter(INITIALISE);

    //     8     %end

    _imp_return;
    _imp_begin_backtrace(INITIALISE);
    _imp_diagf("\nLocal Variables:\n\n");
    _imp_end_backtrace();
  } /* end of INITIALISE */

  //     9
  //    10  !  This fails to translate - the field is not found. *BUT* ONLY IF icode2ast IS RUN WITHOUT "-d"!
  //    11
  //    12     Interface_k = 23;

  INTERFACE->K = 23;

  //    13
  //    14  %end

  _imp_return;
  _imp_begin_backtrace(PASS2);
  _imp_diagf("\n\nArguments:\n\n");
  _imp_diagf("\nLocal Variables:\n\n");
  _imp_end_backtrace();
} /* end of PASS2 */

// ?INITIALISE unused
//    15
//    16  %endoffile