-# Copyright 2011-2019 Free Software Foundation, Inc.
+# Copyright 2011-2020 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
}
gdb_test "step" "bar \\(\\) at.*" "step 1"
- gdb_test "step" ".*" "step 2"; # Return from foo()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
- gdb_test "step" ".*" "step 4"; # Return from bar()
+ gdb_test "step" ".*" "step 2"; # Return from bar()
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" \
+ "main \\(\\) at .*\r\n$gdb_prompt " "step"
+ gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}
gdb_test_no_output "skip enable 7"
gdb_test "step" "bar \\(\\) at.*" "step 1"
gdb_test "step" ".*" "step 2"; # Return from bar()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" \
+ "main \\(\\) at .*\r\n$gdb_prompt " "step"
gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}
gdb_test_no_output "skip enable 8"
gdb_test "step" "bar \\(\\) at.*" "step 1"
gdb_test "step" ".*" "step 2"; # Return from bar()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" \
+ "main \\(\\) at .*\r\n$gdb_prompt " "step"
gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}