diff options
Diffstat (limited to 'gdb/testsuite/gdb.hp/ctti-add.cc')
-rw-r--r-- | gdb/testsuite/gdb.hp/ctti-add.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/ctti-add.cc b/gdb/testsuite/gdb.hp/ctti-add.cc new file mode 100644 index 0000000..1f50fae --- /dev/null +++ b/gdb/testsuite/gdb.hp/ctti-add.cc @@ -0,0 +1,29 @@ +template<class T> T add(T v1, T v2) +{ + T v3; + v3 = v1; + v3 += v2; + return v3; + } + +int main() +{ + char c; + int i; + float f; + extern void add1(); + extern void subr2(); + extern void subr3(); + + c = 'a'; + i = 2; + f = 4.5; + + c = add(c, c); + i = add(i, i); + f = add(f, f); + + add1(); + subr2(); + subr3(); +} |