summaryrefslogtreecommitdiff
path: root/testsuite/ltrace.minor/demangle-lib.cpp
blob: 3091f313c3be7a324dc2afd462a171ab1432c3f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include<stddef.h>
#include<iostream>
#include<cstdlib>
#include"demangle.h"

/* Number of arguments */
int Fi_i(int bar) 		{ return 0; }
int Fi_s(short bar) 		{return 0; }
int Fii_i(int bar, int goo) 	{ return 0; }
int Fiii_i(int bar, int goo, int hoo) { return 0; }
int Fie_i(int bar, ...) 	{ return 0; }

/* Return types */
void Fv_v(void) 		{ ; }
char Fv_c(void) 		{ return 0; }
signed char Fv_Sc(void) 	{ return 0; }
unsigned char Fv_Uc(void) 	{ return 0; }
short Fv_s(void) 		{ return 0; }
unsigned short Fv_Us(void) 	{ return 0; }
int Fv_i(void) 			{ return 0; }
const int Fv_Ci(void) 		{ return 0; }
unsigned int Fv_Ui(void) 	{ return 0; }
volatile int Fv_Vi(void) 	{ return 0; }
long Fv_l(void) 		{ return 0; }
unsigned long Fv_Ul(void) 	{ return 0; }
float Fv_f(void) 		{ return 0; }
double Fv_g(void) 		{ return 0; }
long double Fv_Lg(void) 	{ return 0; }

/* Pointers */
void *Fv_Pv(void) 		{ return 0; }
void **Fv_PPv(void) 		{ return 0; }

/* References */
int& Fv_Ri(void) 		{ static int x; return x; }

/* Argument types */
int FPi_i(int *a) 		{ return 0; }
int FA10_i_i(int a[10]) 	{ return 0; }
int Fc_i(char bar) 		{ return 0; }
int Ff_i(float bar) 		{ return 0; }
int Fg_i(double bar) 		{ return 0; }

/* Function pointers */
typedef int (*x)(int);
typedef int (*y)(short);

int Fx_i(x fnptr) 		{ return 0; }
int Fxx_i(x fnptr, x fnptr2) 	{ return 0; }
int Fxxx_i(x fnptr, x fnptr2, 
	x fnptr3) 		{ return 0; }
int Fxxi_i(x fnptr, x fnptr2, 
	x fnptr3, int i) 	{ return 0; }
int Fxix_i(x fnptr, int i, 
	x fnptr3) 		{ return 0; }
int Fxyxy_i(x fnptr, y fnptr2, 
	x fnptr3, y fnptr4) 	{ return 0; }

/* Class methods */
class myclass;
myclass::myclass(void) 		{ myint = 0; }
myclass::myclass(int x) 	{ myint = x; }
myclass::~myclass() 		{ ; }

int myclass::Fi_i(int bar) 	{ return myint; }
int myclass::Fis_i(int bar) 	{ return bar; }

void* myclass::operator new(size_t size)
{
  void* p = malloc(size);return p;
}
void myclass::operator delete(void *p) {free(p);}

myclass myclass::operator++() 	{ return myclass(++myint); }
myclass myclass::operator++(int) { return myclass(myint++); }

/* Binary */
myclass myclass::operator+(int x) { return myclass(myint + x); }

/* Assignment */
myclass& myclass::operator=(const myclass& from) 
{ 
	myint = from.myint; 
	return *this; 
}

/* test clashes */
class nested;

nested::nested(void) 		{ ; }
nested::~nested() 		{ ; }
int nested::Fi_i(int bar) 	{ return bar; }

void Fmyclass_v(myclass m) 	{ ; }
void Fmxmx_v(myclass arg1, x arg2, 
	myclass arg3, x arg4) 	{ ; }