gdb_test "print test2.key2" "${::valnum_re} = 77" "derived template object, base static long"
# derived template object, base static enum
-gdb_test "print test2.value" "\\$\[0-9\].* = oriental" "derived template object, base static enum"
+gdb_test "print test2.value" "${::valnum_re} = oriental" "derived template object, base static enum"
# derived template object, static enum
-gdb_test "print test2.value_derived" "\\$\[0-9\].* = etruscan" "derived template object, static enum"
+gdb_test "print test2.value_derived" "${::valnum_re} = etruscan" "derived template object, static enum"
# Three.
# template object, static derived template data member's base static const bool
-gdb_test "print test3.data.test" "\\$\[0-9\].* = true" "template object, static const bool"
+gdb_test "print test3.data.test" "${::valnum_re} = true" "template object, static const bool"
# template object, static derived template data member's base static const int
-gdb_test "print test3.data.key1" "\\$\[0-9\].* = 5" "template object, static const int"
+gdb_test "print test3.data.key1" "${::valnum_re} = 5" "template object, static const int"
# template object, static derived template data member's base static long
-gdb_test "print test3.data.key2" "\\$\[0-9\].* = 77" "template object, static long"
+gdb_test "print test3.data.key2" "${::valnum_re} = 77" "template object, static long"
# template object, static derived template data member's base static enum
-gdb_test "print test3.data.value" "\\$\[0-9\].* = oriental" "template object, static enum"
+gdb_test "print test3.data.value" "${::valnum_re} = oriental" "template object, static enum"
# template object, static derived template data member's static enum
-gdb_test "print test3.data.value_derived" "\\$\[0-9\].* = etruscan" "template object, static derived enum"
+gdb_test "print test3.data.value_derived" "${::valnum_re} = etruscan" "template object, static derived enum"
# 2002-08-16
# Four.
# static const int initialized in another file.
-gdb_test "print test4.elsewhere" "\\$\[0-9\].* = 221" "static const int initialized elsewhere"
+gdb_test "print test4.elsewhere" "${::valnum_re} = 221" "static const int initialized elsewhere"
# static const int that nobody initializes. From PR gdb/635.
if {[test_compiler_info {gcc-[0-3]-*}]
# static const initialized in the class definition, PR gdb/11702.
if { $non_dwarf } { setup_xfail *-*-* }
-gdb_test "print test4.everywhere" "\\$\[0-9\].* = 317" "static const int initialized in class definition"
+gdb_test "print test4.everywhere" "${::valnum_re} = 317" "static const int initialized in class definition"
if { $non_dwarf } { setup_xfail *-*-* }
-gdb_test "print test4.somewhere" "\\$\[0-9\].* = 3.14\[0-9\]*" "static const float initialized in class definition"
+gdb_test "print test4.somewhere" "${::valnum_re} = 3.14\[0-9\]*" "static const float initialized in class definition"
# Also make sure static const members can be found via "info var".
if { $non_dwarf } { setup_xfail *-*-* }
gdb_test "whatis ::C::cOtherFileType" "type = short"
gdb_test "whatis C::cOtherFileVar" "type = const C::cOtherFileType"
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"
+gdb_test "print C::cOtherFileVar" "${::valnum_re} = 319"
+gdb_test "print ::C::cOtherFileVar" "${::valnum_re} = 319"
if {$xfail_class_types} { setup_xfail *-*-* }
gdb_test "whatis C::OtherFileClass::cOtherFileClassType" "type = short"
gdb_test $test2 " = 318"
}
- -re "\\$\[0-9\].* = 318\r\n$gdb_prompt $" {
+ -re "${::valnum_re} = 318\r\n$gdb_prompt $" {
# Do not permit to XFAIL on recent GCCs.
if {$xfail_class_types} {
setup_xfail *-*-*
return
}
-gdb_test "print c" "\\$\[0-9\].* = 1"
+gdb_test "print c" "${::valnum_re} = 1"
gdb_test "print cc" "No symbol \"cc\" in current context."
-gdb_test "print 'C::cc'" "\\$\[0-9\].* = 2"
-gdb_test "print C::cc" "\\$\[0-9\].* = 2"
-gdb_test "print cd" "\\$\[0-9\].* = 3"
+gdb_test "print 'C::cc'" "${::valnum_re} = 2"
+gdb_test "print C::cc" "${::valnum_re} = 2"
+gdb_test "print cd" "${::valnum_re} = 3"
gdb_test "print C::D::cd" "No type \"D\" within class or namespace \"C::C\"."
-gdb_test "print 'E::cde'" "\\$\[0-9\].* = 5"
-gdb_test "print E::cde" "\\$\[0-9\].* = 5"
-gdb_test "print shadow" "\\$\[0-9\].* = 13"
+gdb_test "print 'E::cde'" "${::valnum_re} = 5"
+gdb_test "print E::cde" "${::valnum_re} = 5"
+gdb_test "print shadow" "${::valnum_re} = 13"
gdb_test "print E::ce" "No symbol \"ce\" in namespace \"C::D::E\"."
gdb_test "ptype C" "type = namespace C::C"
gdb_test "ptype E" "type = namespace C::D::E"
# Tests involving multiple files
-gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
+gdb_test "print cOtherFile" "${::valnum_re} = 316"
gdb_test "ptype OtherFileClass" "type = (class C::OtherFileClass \{\r\n public:|struct C::OtherFileClass \{)\r\n int z;\r\n.*\}"
gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n public:\r\n int z;\r\n.*\}"
gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"."
# Some anonymous namespace tests.
-gdb_test "print cX" "\\$\[0-9\].* = 6"
-gdb_test "print 'F::cXf'" "\\$\[0-9\].* = 7"
-gdb_test "print F::cXf" "\\$\[0-9\].* = 7"
-gdb_test "print F::cXfX" "\\$\[0-9\].* = 8"
-gdb_test "print X" "\\$\[0-9\].* = 9"
-gdb_test "print 'G::Xg'" "\\$\[0-9\].* = 10"
-gdb_test "print G::Xg" "\\$\[0-9\].* = 10"
-gdb_test "print G::XgX" "\\$\[0-9\].* = 11"
+gdb_test "print cX" "${::valnum_re} = 6"
+gdb_test "print 'F::cXf'" "${::valnum_re} = 7"
+gdb_test "print F::cXf" "${::valnum_re} = 7"
+gdb_test "print F::cXfX" "${::valnum_re} = 8"
+gdb_test "print X" "${::valnum_re} = 9"
+gdb_test "print 'G::Xg'" "${::valnum_re} = 10"
+gdb_test "print G::Xg" "${::valnum_re} = 10"
+gdb_test "print G::XgX" "${::valnum_re} = 11"
gdb_test "print cXOtherFile" "No symbol \"cXOtherFile\" in current context."
gdb_test "print XOtherFile" "No symbol \"XOtherFile\" in current context."
# Enum tests.
-gdb_test "print AAA::ALPHA" "\\$\[0-9\].* = AAA::ALPHA"
+gdb_test "print AAA::ALPHA" "${::valnum_re} = AAA::ALPHA"
# Regression tests for PR 9496.
gdb_test "whatis ::C::CClass::NestedClass" "type = C::CClass::NestedClass"