+2011-07-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Test GCC PR debug/49546.
+ * gdb.cp/temargs.exp (set sixth breakpoint for temargs)
+ (test type of F in k3_m, test value of F in k3_m): New.
+ * gdb.cp/temargs.cc (struct S3, struct K3): New.
+ (main): New variable k3. Call k3.k3_m.
+
2011-06-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.dwarf2/dw2-filename.exp (info sources): New testcase.
// Breakpoint 3.
}
+// GCC PR debug/49546
+struct S3
+{
+ static void m (int x) {}
+};
+template <void (*F) (int)>
+// or: template <void (F) (int)>
+struct K3
+{
+ void k3_m ()
+ {
+ F (0); // Breakpoint 6.
+ }
+};
+
int main ()
{
Base<double, 23, &a_global, &S::f> base;
// Note that instantiating with P==0 does not work with g++.
// That would be worth testing, once g++ is fixed.
Base<long, 47, &a_global, &S::f>::Inner<float> inner;
+ K3<&S3::m> k3;
+// or: K3<S3::m> k3;
base.base_m ();
inner.inner_m ();
func<unsigned char, 91, &a_global, &S::f> ();
base.templ_m<short> ();
+ k3.k3_m ();
return 0;
}
setup_kfail "gcc/41736" *-*-*
gdb_test "print MP" "&S::f" "test value of MP in base_m"
+set line [gdb_get_line_number "Breakpoint 6" $srcfile]
+gdb_test "break $srcfile:$line" "Breakpoint 6.*" \
+ "set sixth breakpoint for temargs"
+
#
# Tests in Inner::inner_m.
#
if $have_older_template_gcc { setup_xfail "*-*-*" }
gdb_test "whatis Q" "short" "test type of Q in templ_m"
+
+#
+# Tests in K3::k3_m, GCC PR debug/49546.
+# The problem reproduces with DW_AT_MIPS_linkage_name. It does not happen with
+# GDB physname - GDB's own computation of the linkage name based on
+# (incorrectly output by GCC) DW_AT_name.
+#
+
+gdb_continue_to_breakpoint "continue to sixth breakpoint for temargs"
+
+if $have_older_template_gcc { setup_xfail "*-*-*" }
+gdb_test "ptype F" {type = void \(\*\)\(int\)} "test type of F in k3_m"
+
+if $have_older_template_gcc { setup_xfail "*-*-*" }
+gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ <S3::m\(int\)>} \
+ "test value of F in k3_m"