-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
standard_testfile .cc
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
{debug c++}] != "" } {
- untested "Couldn't compile ${srcfile}"
+ untested "failed to compile"
return -1
}
return
}
# There is no executable code in main(), so we are where we want to be
- gdb_test "print foo" ".*"
- gdb_test_no_output "python foo = gdb.history(0)"
+ gdb_test "print (foo)" ".*" \
+ "print (foo) in template test of $type"
+ gdb_test_no_output "python foo = gdb.history(0)" \
+ "fetch foo from gdb.history(0) in template test of $type"
# Replace '*' with '\*' in regex.
regsub -all {\*} $type {\*} t
- gdb_test "python print foo.type.template_argument(0)" $t $type
+ gdb_test "python print (foo.type.template_argument(0))" $t $type
+
+ gdb_test "python print(foo.type.template_argument(-1))" \
+ "Template argument number must be non-negative\r\nError while executing Python code." \
+ "negative template argument number in template test of $type"
}
test_template_arg "${binfile}-ci" "const int"