NAME=att subrel
FILE=bins/mach0/mac-ls
CMDS=<<EOF
e asm.syntax=att
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
EXPECT=<<EOF
  ;-- main:
  ;-- entry0:
  ;-- func.100001058:
  0x100001058      pushq %rbp
  0x100001059      movq  %rsp, %rbp
  0x10000105c      pushq %r15
  0x10000105e      pushq %r14
  0x100001060      pushq %r13
  0x100001062      pushq %r12
  0x100001064      pushq %rbx
  0x100001065      subq  $0x648, %rsp
  0x10000106c      movq  %rsi, %rbx
  0x10000106f      movl  %edi, %r14d
  0x100001072      leaq  -0x640(%rbp), %rax
  0x100001079      movq  %rax, -0x648(%rbp)
  0x100001080      testl %r14d, %r14d
  0x100001083      jg    0x10000108a
  0x100001085      callq sym.func.100004401
  0x10000108a      leaq  section.4.__TEXT.__cstring, %rsi
  0x100001091      xorl  %edi, %edi
  0x100001093      callq sym.imp.setlocale
  0x100001098      movl  $1, %r13d
  0x10000109e      movl  $1, %edi
EOF
RUN

NAME=att varsub
FILE=bins/mach0/mac-ls
CMDS=<<EOF
af
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
EXPECT=<<EOF
  ;-- entry0:
  ;-- func.100001058:
/ 2259: int main (int argc, char **argv);
| 0x100001058      pushq %rbp
| 0x100001059      movq  %rsp, %rbp
| 0x10000105c      pushq %r15
| 0x10000105e      pushq %r14
| 0x100001060      pushq %r13
| 0x100001062      pushq %r12
| 0x100001064      pushq %rbx
| 0x100001065      subq  $0x648, %rsp
| 0x10000106c      movq  %rsi, %rbx
| 0x10000106f      movl  %edi, %r14d
| 0x100001072      leaq  var_640h, %rax
| 0x100001079      movq  %rax, var_648h
| 0x100001080      testl %r14d, %r14d
| 0x100001083      jg    0x10000108a
| 0x100001085      callq sym.func.100004401
| 0x10000108a      leaq  section.4.__TEXT.__cstring, %rsi
| 0x100001091      xorl  %edi, %edi
| 0x100001093      callq sym.imp.setlocale
| 0x100001098      movl  $1, %r13d
| 0x10000109e      movl  $1, %edi
EOF
RUN

NAME=att varsub 2
FILE=bins/elf/varsub
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pdf
EOF
EXPECT=<<EOF
/ 42: int main (int argc, char **argv, char **envp);
| 0x004004a6      pushq %rbp
| 0x004004a7      movq  %rsp, %rbp
| 0x004004aa      movq  arg_8h, %rax
| 0x004004af      movq  -8(%rsp), %rax
| 0x004004b4      movq  arg_8h, %rax
| 0x004004b8      movq  var_8h, %rax
| 0x004004bc      movq  arg_18h, %rax
| 0x004004c1      movq  -0x18(%rsp), %rax
| 0x004004c6      movq  arg_18h, %rax
| 0x004004ca      movq  var_18h, %rax
| 0x004004ce      leave
\ 0x004004cf      retq
EOF
RUN

NAME=att varsub 2 with asm.sub.varonly disabled
FILE=bins/elf/varsub
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
e asm.sub.varonly=false
pdf
EOF
EXPECT=<<EOF
/ 42: int main (int argc, char **argv, char **envp);
| 0x004004a6      pushq %rbp
| 0x004004a7      movq  %rsp, %rbp
| 0x004004aa      movq  arg_8h(%rsp), %rax
| 0x004004af      movq  -8(%rsp), %rax
| 0x004004b4      movq  arg_8h(%rbp), %rax
| 0x004004b8      movq  var_8h(%rbp), %rax
| 0x004004bc      movq  arg_18h(%rsp), %rax
| 0x004004c1      movq  -0x18(%rsp), %rax
| 0x004004c6      movq  arg_18h(%rbp), %rax
| 0x004004ca      movq  var_18h(%rbp), %rax
| 0x004004ce      leave
\ 0x004004cf      retq
EOF
RUN
