xref: /openbmc/qemu/tests/tcg/s390x/gdbstub/test-svc.py (revision 1764ad70)
1"""Test single-stepping SVC.
2
3This runs as a sourced script (via -x, via run-test.py)."""
4from __future__ import print_function
5import gdb
6from test_gdbstub import main, report
7
8
9def run_test():
10    """Run through the tests one by one"""
11    report("lghi\t" in gdb.execute("x/i $pc", False, True), "insn #1")
12    gdb.execute("si")
13    report("larl\t" in gdb.execute("x/i $pc", False, True), "insn #2")
14    gdb.execute("si")
15    report("lgrl\t" in gdb.execute("x/i $pc", False, True), "insn #3")
16    gdb.execute("si")
17    report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #4")
18    gdb.execute("si")
19    report("xgr\t" in gdb.execute("x/i $pc", False, True), "insn #5")
20    gdb.execute("si")
21    report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #6")
22    gdb.execute("si")
23
24
25main(run_test)
26