Use gdb_test_no_output for compile tests expected to pass
authorKeith Seitz <keiths@redhat.com>
Thu, 16 Aug 2018 21:37:49 +0000 (14:37 -0700)
committerKeith Seitz <keiths@redhat.com>
Fri, 17 Aug 2018 00:00:16 +0000 (17:00 -0700)
There is a small think-o in compile.exp:

if { $srcfile3 != "" } {
    gdb_test "p constvar" " = 3"
    gdb_test "info addr constvar" {Symbol "constvar" is constant\.}

    gdb_test "compile code globalvar = constvar;"; # INCORRECT
    gdb_test "print globalvar" " = 3" "print constvar value"
} else {
    untested "print constvar value"
}

The line marked INCORRECT runs a simple "compile code" which is expected
to succeed.  When this happens, the compile plug-in and GDB will not
output anything.  The use of gdb_test matches against anything.

This is certainly not the intent, and this patch corrects the two instances
of this in the file.  [The rest of gdb.compile looks okay.]

testsuite/ChangeLog:

* gdb.compile/compile.exp: Use gdb_test_no_output for "compile code"
tests expected to pass.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.compile/compile.exp

index 1b4dde59bb6ec427962d9bcb5710cd7f04893975..84ef82f36708e030ebdbcc334a8e9e434347ebbe 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-16  Keith Seitz  <keiths@redhat.com>
+
+       * gdb.compile/compile.exp: Use gdb_test_no_output for "compile code"
+       tests expected to pass.
+
 2018-08-14  Jan Vrany  <jan.vrany@fit.cvut.cz>
 
        * gdb.mi/mi-disassemble.exp (test_disassembly_only): Add tests for
index 4303c02f26f8185c54dc88b74a5e89fd580e3b36..2ed5577752bab45c3dee7639fcaaf126b37d192c 100644 (file)
@@ -256,7 +256,7 @@ gdb_test "print union_object.intfield" " = 7"
 # LOC_UNRESOLVED tests.
 
 gdb_test "print unresolved" " = 20"
-gdb_test "compile code globalvar = unresolved;"
+gdb_test_no_output "compile code globalvar = unresolved;"
 gdb_test "print globalvar" " = 20" "print unresolved value"
 
 # Test shadowing with global and static variables.
@@ -353,7 +353,7 @@ if { $srcfile3 != "" } {
     gdb_test "p constvar" " = 3"
     gdb_test "info addr constvar" {Symbol "constvar" is constant\.}
 
-    gdb_test "compile code globalvar = constvar;"
+    gdb_test_no_output "compile code globalvar = constvar;"
     gdb_test "print globalvar" " = 3" "print constvar value"
 } else {
     untested "print constvar value"
This page took 0.036616 seconds and 4 git commands to generate.