(command.CommandList
  children: [
    (command.ShFunction
      name: check
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [
                            (C {<grep>} {<-q>} {(DQ ($ Id.VSub_Number '$2'))} 
                              {(DQ ($ Id.VSub_Number '$1'))}
                            )
                          ]
                          negated: T
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} {(DQ <'Did not find expected output:'>)})
                    (C {<echo>} {(DQ <'   '> ($ Id.VSub_Number '$2'))})
                    (C {<echo>} {(DQ )})
                    (C {<echo>} {(DQ <'Actual error output below:'>)})
                    (C {<cat>} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [65 82]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check_num
      body: 
        (BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:n)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<grep>} {<-c>} {(DQ ($ Id.VSub_Number '$2'))} {(DQ ($ Id.VSub_Number '$1'))})
                      )
                    }
                  spids: [137]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName '$n'))} {<-ne>} 
                          {(DQ ($ Id.VSub_Number '$3'))}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Found '> ($ Id.VSub_DollarName '$n') <' occurrences (should find '> 
                          ($ Id.VSub_Number '$3') <'):'>
                        )
                      }
                    )
                    (C {<echo>} {(DQ <'   '> ($ Id.VSub_Number '$2'))})
                    (C {<echo>} {(DQ )})
                    (C {<echo>} {(DQ <'Actual error output below:'>)})
                    (C {<cat>} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [153 168]
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:STDOUT)
          op: assign_op.Equal
          rhs: {(DQ <dwp_test_2.stdout>)}
          spids: [220]
        )
      ]
    )
    (C {<check>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'^Contents of the .debug_info.dwo section'>)})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <DW_TAG_compile_unit>)} {<4>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <DW_TAG_type_unit>)} {<3>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: C1'>)} {<3>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: C2'>)} {<2>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: C3'>)} {<3>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: testcase1'>)} {<6>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: testcase2'>)} {<6>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: testcase3'>)} {<6>})
    (C {<check_num>} {($ Id.VSub_DollarName '$STDOUT')} {(DQ <'DW_AT_name.*: testcase4'>)} {<4>})
  ]
)