-# Copyright 2009-2015 Free Software Foundation, Inc.
+# Copyright 2009-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
clean_restart ${exec1}
+gdb_test {print $_inferior} " = 1"
+
# Add an empty inferior, switch to it, and load a main executable into
# it.
gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
gdb_test "file ${binfile2}" ".*" "load ${exec2} file in inferior 2"
+gdb_test {print $_inferior} " = 2" "print \$_inferior after switching"
+
# Add a new inferior and load a main executable into it in one
# command.
gdb_test "add-inferior -exec ${binfile3}" \