gdb_test "ifnospace" ".*hi there.*" "test ifnospace is parsed correctly"
+# Verify that the command parser properly handles command abbreviations.
+with_test_prefix "command abbreviations in define" {
+ set test "define user command: breakmain"
+ gdb_test_multiple "define breakmain" "$test" {
+ -re "Type commands for definition of \"breakmain\".\r\nEnd with a line saying just \"end\".\r\n>$" {
+ pass "$test"
+ set test "send body of breakmain"
+ gdb_test_multiple "break main\ncommand\necho\nend\nend" "$test" {
+ -re "$gdb_prompt $"\
+ {pass "$test"}
+ }
+ }
+ }
+
+ gdb_test "breakmain" ".*Breakpoint .*" "run user command"
+
+ # If GDB fails to interpret properly the abbrev "command", the last "end"
+ # will be missing. Issue it to avoid a desync that would break the other
+ # tests in this file.
+ gdb_test "end" \
+ "This command cannot be used at the top level.*" \
+ "additional end command"
+
+ gdb_test "info break \$bpnum" \
+ [multi_line \
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*" \
+ "\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*" \
+ "\[\t \]+echo.*"] \
+ "info break shows echo command"
+}
+
+
# Verify that the command parser doesn't require a space after an 'while'
# command in a user defined function.
#