NAME=ic dot
FILE=bins/mach0/BatteryLife.arm_64.1
CMDS=<<EOF
s 0x1000fbef0
ic.
fd
pd 3
EOF
EXPECT=<<EOF
GADDevice::jailbroken
method.GADDevice.jailbroken
            ;-- method.GADDevice.jailbroken:
            ;-- func.1000fbef0:
            0x1000fbef0      f44fbea9       stp x20, x19, [sp, -0x20]!
            0x1000fbef4      fd7b01a9       stp x29, x30, [sp, 0x10]
            0x1000fbef8      fd430091       add x29, sp, 0x10
EOF
RUN

NAME=ic swift
FILE=bins/mach0/main-inherit
CMDS=<<EOF
ic
?e ---
icc
?e ---
icj~{}
EOF
EXPECT=<<EOF
0x00003e44 [0x00003e44 - 0x00003e44]      0 swift class 0 Employee
0x100003f60 swift property   0      name
0x00003eac [0x00003eac - 0x00003eac]      0 swift class 1 Employer
0x100008148 [0x100008148 - 0x100008148]      0 objc class 2 main.Employee :: Swift._SwiftObject
0x00000000 objc      var   0      isa
0x100003e30 objc      var   1      name
0x100008200 [0x100008200 - 0x100008200]      0 objc class 3 main.Employer :: main.Employee
0x00000000 [0x100003f04 - 0x100003f04]      0 ? class 4 Greet
0x100003f04 ?   method   0      symbolic main.Greet.
0x00000000 [0x100003f14 - 0x100003f14]      0 ? class 5 Employee_1
0x100003f14 ?   method   0      symbolic main.Employee.allocator
0x00000000 [0x100003f1e - 0x100003f1e]      0 ? class 6 Employer_1
0x100003f1e ?   method   0      symbolic main.Employer.allocator
---
class Employee {
  property name : Swift.String;
}
class Employer {
}
@objc
class main.Employee : Swift._SwiftObject {
  var isa : struct objc_class *;
  var name;
}
@objc
class main.Employer : main.Employee {
}
class Greet {
  func symbolic main.Greet.() {}  // 0x100003f04
}
class Employee_1 {
  func symbolic main.Employee.allocator() {}  // 0x100003f14
}
class Employer_1 {
  func symbolic main.Employer.allocator() {}  // 0x100003f1e
}
---
[
  {
    "classname": "Employee",
    "addr": 15940,
    "lang": "swift",
    "index": 0,
    "fields": [
      {
        "name": "name",
        "kind": "property",
        "type": "Swift.String",
        "addr": 4294983520
      }
    ]
  },
  {
    "classname": "Employer",
    "addr": 16044,
    "lang": "swift",
    "index": 1
  },
  {
    "classname": "main.Employee",
    "addr": 4295000392,
    "lang": "objc",
    "index": 2,
    "super": [
      "Swift._SwiftObject"
    ],
    "rawsuper": [
      "_OBJC_CLASS_$__TtCs12_SwiftObject"
    ],
    "fields": [
      {
        "name": "isa",
        "kind": "var",
        "type": "struct objc_class *",
        "addr": 0
      },
      {
        "name": "name",
        "kind": "var",
        "addr": 4294983216
      }
    ]
  },
  {
    "classname": "main.Employer",
    "addr": 4295000576,
    "lang": "objc",
    "index": 3,
    "super": [
      "main.Employee"
    ],
    "rawsuper": [
      "_TtC4main8Employee"
    ]
  },
  {
    "classname": "Greet",
    "addr": 0,
    "index": 4,
    "methods": [
      {
        "name": "symbolic main.Greet.",
        "flag": "method.Greet.symbolic_main.Greet.",
        "rawname": "_symbolic $s4main5GreetP",
        "addr": 4294983428
      }
    ]
  },
  {
    "classname": "Employee_1",
    "addr": 0,
    "index": 5,
    "methods": [
      {
        "name": "symbolic main.Employee.allocator",
        "flag": "method.Employee_1.symbolic_main.Employee.allocator",
        "rawname": "_symbolic _____ 4main8EmployeeC",
        "addr": 4294983444
      }
    ]
  },
  {
    "classname": "Employer_1",
    "addr": 0,
    "index": 6,
    "methods": [
      {
        "name": "symbolic main.Employer.allocator",
        "flag": "method.Employer_1.symbolic_main.Employer.allocator",
        "rawname": "_symbolic _____ 4main8EmployerC",
        "addr": 4294983454
      }
    ]
  }
]
EOF
RUN

NAME=icqq swift
FILE=bins/mach0/main-inherit
CMDS=<<EOF
icqq
EOF
EXPECT=<<EOF
Employee
Employer
main.Employee
main.Employer
Greet
Employee_1
Employer_1
EOF
RUN

NAME=icq swift
FILE=bins/mach0/main-inherit
CMDS=<<EOF
icq
EOF
EXPECT=<<EOF
0x00003e44 [0x00003e44 - 0x00003e44] swift Employee
0x00003eac [0x00003eac - 0x00003eac] swift Employer
0x100008148 [0x100008148 - 0x100008148] objc main.Employee Swift._SwiftObject
0x100008200 [0x100008200 - 0x100008200] objc main.Employer main.Employee
0x00000000 [0x100003f04 - 0x100003f04] ? Greet
0x00000000 [0x100003f14 - 0x100003f14] ? Employee_1
0x00000000 [0x100003f1e - 0x100003f1e] ? Employer_1
EOF
RUN
