old-cross-binutils/gdb/testsuite/gdb.cp/mb-templates.cc
Doug Evans 9ab4e74422 * gdb.cp/mb-ctor.exp: Add multi-line source statement test.
* gdb.cp/mb-ctor.cc: Ditto.
	* gdb.cp/mb-inline.exp: Add multi-line source statement test.
	* gdb.cp/mb-inline.h (multi_line_foo): New function.
	* gdb.cp/mb-inline1.cc: Call it.
	* gdb.cp/mb-inline2.cc: Ditto.
	* gdb.cp/mb-templates.exp: Add multi-line source statement test.
	* gdb.cp/mb-templates.cc (multi_line_foo): New template.
2009-04-29 22:45:11 +00:00

31 lines
436 B
C++

#include <iostream>
using namespace std;
template<class T>
void foo(T i)
{
std::cout << "hi\n"; // set breakpoint here
}
template<class T>
void multi_line_foo(T i)
{
std::cout // set multi-line breakpoint here
<< "hi\n";
}
int main()
{
foo<int>(0);
foo<double>(0);
foo<int>(1);
foo<double>(1);
foo<int>(2);
foo<double>(2);
multi_line_foo<int>(0);
multi_line_foo<double>(0);
return 0;
}