aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-07-15 18:46:10 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-07-15 18:46:10 +0000
commite9ea266294fcba2548c9b30d8229b1b430d45eee (patch)
tree6adbf59421c8e0b179bae0dfe13e06a3ab5c474e
parent7d1726872032004915cd16e53cc781af2adb2873 (diff)
downloadfsf-binutils-gdb-e9ea266294fcba2548c9b30d8229b1b430d45eee.zip
fsf-binutils-gdb-e9ea266294fcba2548c9b30d8229b1b430d45eee.tar.gz
fsf-binutils-gdb-e9ea266294fcba2548c9b30d8229b1b430d45eee.tar.bz2
gdb/testsuite/
Code cleanup. * gdb.cp/namespace.exp (xfail_class_types): New variable. Initialize it. Substitute it instead of test_compiler_info everywhere.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.cp/namespace.exp34
2 files changed, 18 insertions, 22 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9b6a2a1..f4c53a4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * gdb.cp/namespace.exp (xfail_class_types): New variable. Initialize
+ it. Substitute it instead of test_compiler_info everywhere.
+
2011-07-15 Ulrich Weigand <ulrich.weigand@linaro.org>
* gdb.base/type-opaque.exp: Use gdb_load_shlibs. Run test on
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index ce5bfeb..f846eb1 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -43,6 +43,13 @@ if [get_compiler_info ${binfile} c++] {
return -1;
}
+set xfail_class_types 0
+if {[test_compiler_info {gcc-[0-3]-*}]
+ || [test_compiler_info {gcc-4-[0-4]-*}]} {
+ # The type in class is missing in older GCCs.
+ set xfail_class_types 1
+}
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug c++}] != "" } {
untested namespace.exp
return -1
@@ -174,17 +181,9 @@ gdb_test "whatis ::C::cOtherFileVar" "type = const C::cOtherFileType"
gdb_test "print C::cOtherFileVar" "\\$\[0-9\].* = 319"
gdb_test "print ::C::cOtherFileVar" "\\$\[0-9\].* = 319"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "whatis C::OtherFileClass::cOtherFileClassType" "type = short"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "whatis ::C::OtherFileClass::cOtherFileClassType" "type = short"
gdb_test "print C::OtherFileClass::cOtherFileClassVar" " = 318"
@@ -200,8 +199,7 @@ gdb_test_multiple $test $test {
}
-re "\\$\[0-9\].* = 318\r\n$gdb_prompt $" {
# Do not permit to XFAIL on recent GCCs.
- if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
+ if $xfail_class_types {
setup_xfail *-*-*
fail $test
# Unresolved means human intervention is required to determine
@@ -257,17 +255,9 @@ gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"
# Test class typedefs printing.
set expect "type = class C::OtherFileClass \{\r\n.*\r\n *typedef short cOtherFileClassType;\r\n *typedef long cOtherFileClassType2;\r\n\}"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "ptype OtherFileClass" $expect "ptype OtherFileClass typedefs"
-if {[test_compiler_info {gcc-[0-3]-*}]
- || [test_compiler_info {gcc-4-[0-4]-*}]} {
- # The type in class is missing in older GCCs.
- setup_xfail *-*-*
-}
+if $xfail_class_types { setup_xfail *-*-* }
gdb_test "ptype ::C::OtherFileClass" $expect "ptype ::C::OtherFileClass typedefs"
# Some anonymous namespace tests.