# merged: ELF PPC64: ELFv1 glink stubs keep the 8-byte stride
NAME=ELF PPC64: ELFv1 e_flags selects the elfv1 abi and the default cc
FILE=bins/elf/ppc64v1-more
CMDS=<<EOF
e asm.abi
e anal.cc
?e --
ii~FUNC[1]:0..3
EOF
EXPECT=<<EOF
elfv1
ppc-64
--
0x0000db04
0x0000db0c
0x0000db14
EOF
RUN

# merged: ELF PPC64: a new function inherits the elfv2 cc; ELF PPC64: big-endian ELFv2 glink stubs use the 4-byte stride
NAME=ELF PPC64: big-endian ELFv2 e_flags selects the elfv2 cc
FILE=bins/elf/ppc64_sudoku_dwarf
CMDS=<<EOF
e asm.abi
e anal.cc
k anal/cc/cc.elfv2.shadow
?e --
af @ entry0
afc @ entry0
?e --
ii~FUNC[1]:0..3
EOF
EXPECT=<<EOF
elfv2
elfv2
96
--
elfv2
--
0x10001d10
0x10001d14
0x10001d18
EOF
RUN

# merged: ELF PPC64: little-endian ELFv2 imports resolve to glink stubs
NAME=ELF PPC64: little-endian ELFv2 selects the elfv2 cc
FILE=bins/elf/mosquito-ppc64le
CMDS=<<EOF
e asm.abi
e anal.cc
?e --
ii~FUNC[1]:0..3
EOF
EXPECT=<<EOF
elfv2
elfv2
--
0x10002ae0
0x10002ae4
0x10002ae8
EOF
RUN

NAME=ELF PPC64: anal.cc tracks the abi when switching binaries in one session
FILE=bins/elf/ppc64_sudoku_dwarf
CMDS=<<EOF
e anal.cc
o bins/elf/ppc64v1-more
e anal.cc
o bins/elf/ppc64_sudoku_dwarf
e anal.cc
EOF
EXPECT=<<EOF
elfv2
ppc-64
elfv2
EOF
RUN
