demangle lib.cstdlib
[platform/upstream/ltrace.git] / testsuite / ltrace.minor / demangle-lib.cpp
1 #include<stddef.h>
2 #include<cstdlib>
3 #include<iostream>
4 #include<cstdlib>
5 #include"demangle.h"
6
7 /* Number of arguments */
8 int Fi_i(int bar)               { return 0; }
9 int Fi_s(short bar)             {return 0; }
10 int Fii_i(int bar, int goo)     { return 0; }
11 int Fiii_i(int bar, int goo, int hoo) { return 0; }
12 int Fie_i(int bar, ...)         { return 0; }
13
14 /* Return types */
15 void Fv_v(void)                 { ; }
16 char Fv_c(void)                 { return 0; }
17 signed char Fv_Sc(void)         { return 0; }
18 unsigned char Fv_Uc(void)       { return 0; }
19 short Fv_s(void)                { return 0; }
20 unsigned short Fv_Us(void)      { return 0; }
21 int Fv_i(void)                  { return 0; }
22 const int Fv_Ci(void)           { return 0; }
23 unsigned int Fv_Ui(void)        { return 0; }
24 volatile int Fv_Vi(void)        { return 0; }
25 long Fv_l(void)                 { return 0; }
26 unsigned long Fv_Ul(void)       { return 0; }
27 float Fv_f(void)                { return 0; }
28 double Fv_g(void)               { return 0; }
29 long double Fv_Lg(void)         { return 0; }
30
31 /* Pointers */
32 void *Fv_Pv(void)               { return 0; }
33 void **Fv_PPv(void)             { return 0; }
34
35 /* References */
36 int& Fv_Ri(void)                { static int x; return x; }
37
38 /* Argument types */
39 int FPi_i(int *a)               { return 0; }
40 int FA10_i_i(int a[10])         { return 0; }
41 int Fc_i(char bar)              { return 0; }
42 int Ff_i(float bar)             { return 0; }
43 int Fg_i(double bar)            { return 0; }
44
45 /* Function pointers */
46 typedef int (*x)(int);
47 typedef int (*y)(short);
48
49 int Fx_i(x fnptr)               { return 0; }
50 int Fxx_i(x fnptr, x fnptr2)    { return 0; }
51 int Fxxx_i(x fnptr, x fnptr2, 
52         x fnptr3)               { return 0; }
53 int Fxxi_i(x fnptr, x fnptr2, 
54         x fnptr3, int i)        { return 0; }
55 int Fxix_i(x fnptr, int i, 
56         x fnptr3)               { return 0; }
57 int Fxyxy_i(x fnptr, y fnptr2, 
58         x fnptr3, y fnptr4)     { return 0; }
59
60 /* Class methods */
61 class myclass;
62 myclass::myclass(void)          { myint = 0; }
63 myclass::myclass(int x)         { myint = x; }
64 myclass::~myclass()             { ; }
65
66 int myclass::Fi_i(int bar)      { return myint; }
67 int myclass::Fis_i(int bar)     { return bar; }
68
69 void* myclass::operator new(size_t size)
70 {
71   void* p = malloc(size);return p;
72 }
73 void myclass::operator delete(void *p) {free(p);}
74
75 myclass myclass::operator++()   { return myclass(++myint); }
76 myclass myclass::operator++(int) { return myclass(myint++); }
77
78 /* Binary */
79 myclass myclass::operator+(int x) { return myclass(myint + x); }
80
81 /* Assignment */
82 myclass& myclass::operator=(const myclass& from) 
83
84         myint = from.myint; 
85         return *this; 
86 }
87
88 /* test clashes */
89 class nested;
90
91 nested::nested(void)            { ; }
92 nested::~nested()               { ; }
93 int nested::Fi_i(int bar)       { return bar; }
94
95 void Fmyclass_v(myclass m)      { ; }
96 void Fmxmx_v(myclass arg1, x arg2, 
97         myclass arg3, x arg4)   { ; }
98