aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/mb-templates.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.cp/mb-templates.cc')
-rw-r--r--gdb/testsuite/gdb.cp/mb-templates.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/mb-templates.cc b/gdb/testsuite/gdb.cp/mb-templates.cc
new file mode 100644
index 0000000..a7d4e2e
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/mb-templates.cc
@@ -0,0 +1,19 @@
+
+#include <iostream>
+using namespace std;
+
+template<class T>
+void foo(T i)
+{
+ std::cout << "hi\n"; // set breakpoint here
+}
+
+int main()
+{
+ foo<int>(0);
+ foo<double>(0);
+ foo<int>(1);
+ foo<double>(1);
+ foo<int>(2);
+ foo<double>(2);
+}