! This is test/repro.imp but with an extra scope of complexity.
! This recordformat spec does not get passed into the icode file.

begin

recordformat stackfm(integerarray ira(0:9))   { a top-level format of the same name }

begin

recordformatspec stackfm                      { this *should* make a reference to stackfm below come from the inner format }
                                               { but the spec is not passed through to the icode by pass1 }

recordformat blech(integer x, record (stackfm) name link)

recordformat stackfm(integer s)              { inner definition of format }

routine PASS2(integer p, record (blech) puke)
  routine ASSEMBLE(integer AMODE, integer VARS, integer LOCAL, integer PARAMETERLIST, integer name GLOBALATTRIBUTES)
    routine SHOWDATA(record (STACKFM) name V, integer LEFT)
      integer q = V_S                         { use inner definition. This works in icode2c but may be a case of two wrongs making a right! }
    end
  end
end

end

endofprogram