1 /* This test script is part of GDB, the GNU debugger.
3 Copyright 1999-2019 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
31 friend ostream
& operator<<(ostream
& outs
, A1 one
);
41 A1
operator+=(int value
);
42 A1
operator+(const A1
&);
43 A1
operator-(const A1
&);
44 A1
operator%(const A1
&);
45 int operator==(const A1
&);
46 int operator!=(const A1
&);
47 int operator&&(const A1
&);
48 int operator||(const A1
&);
51 A1
operator|(const A1
&);
52 A1
operator^(const A1
&);
53 A1
operator&(const A1
&);
54 int operator<(const A1
&);
55 int operator<=(const A1
&);
56 int operator>=(const A1
&);
57 int operator>(const A1
&);
58 A1
operator*(const A1
&);
59 A1
operator/(const A1
&);
60 A1
operator=(const A1
&);
74 A1
A1::operator+(const A1
& second
)
83 A1
A1::operator*(const A1
& second
)
86 product
.x
= this->x
* second
.x
;
87 product
.y
= this->y
* second
.y
;
92 A1
A1::operator-(const A1
& second
)
95 diff
.x
= x
- second
.x
;
96 diff
.y
= y
- second
.y
;
101 A1
A1::operator/(const A1
& second
)
104 div
.x
= x
/ second
.x
;
105 div
.y
= y
/ second
.y
;
110 A1
A1::operator%(const A1
& second
)
113 rem
.x
= x
% second
.x
;
114 rem
.y
= y
% second
.y
;
119 int A1::operator==(const A1
& second
)
121 int a
= (x
== second
.x
);
122 int b
= (y
== second
.y
);
127 int A1::operator!=(const A1
& second
)
129 int a
= (x
!= second
.x
);
130 int b
= (y
!= second
.y
);
135 int A1::operator&&(const A1
& second
)
137 return ( x
&& second
.x
);
140 int A1::operator||(const A1
& second
)
142 return ( x
|| second
.x
);
145 A1
A1::operator<<(int value
)
148 lshft
.x
= x
<< value
;
149 lshft
.y
= y
<< value
;
154 A1
A1::operator>>(int value
)
157 rshft
.x
= x
>> value
;
158 rshft
.y
= y
>> value
;
163 A1
A1::operator|(const A1
& second
)
166 abitor
.x
= x
| second
.x
;
167 abitor
.y
= y
| second
.y
;
172 A1
A1::operator^(const A1
& second
)
175 axor
.x
= x
^ second
.x
;
176 axor
.y
= y
^ second
.y
;
181 A1
A1::operator&(const A1
& second
)
184 abitand
.x
= x
& second
.x
;
185 abitand
.y
= y
& second
.y
;
190 int A1::operator<(const A1
& second
)
194 return (x
< second
.x
);
197 int A1::operator<=(const A1
& second
)
199 return (x
<= second
.x
);
202 int A1::operator>=(const A1
& second
)
204 return (x
>= second
.x
);
207 int A1::operator>(const A1
& second
)
209 return (x
> second
.x
);
212 int A1::operator!(void)
217 A1
A1::operator-(void)
226 A1
A1::operator+(void)
235 A1
A1::operator~(void)
244 A1
A1::operator++() // pre increment
251 A1
A1::operator++(int) // post increment
258 A1
A1::operator--() // pre decrement
265 A1
A1::operator--(int) // post decrement
273 A1
A1::operator=(const A1
& second
)
282 A1
A1::operator+=(int value
)
291 ostream
& operator<<(ostream
& outs
, A1 one
)
293 return (outs
<< endl
<< "x = " << one
.x
<< endl
<< "y = " << one
.y
<< endl
<< "-------" << endl
);
312 bool operator== (const Member
&m1
, const Member
&m2
)
322 Member
& operator* ();
325 Member
& Container::operator* ()
342 marker1(); // marker1-returns-here
343 cout
<< one
; // marker1-returns-here
346 cout
<< "+ " << three
;
348 cout
<< "- " << three
;
350 cout
<<"* " << three
;
352 cout
<< "/ " << three
;
354 cout
<< "% " << three
;
356 cout
<< "| " <<three
;
358 cout
<< "^ " <<three
;
360 cout
<< "& "<< three
;
363 cout
<< "&& " << val
<< endl
<< "-----"<<endl
;
365 cout
<< "|| " << val
<< endl
<< "-----"<<endl
;
367 cout
<< " == " << val
<< endl
<< "-----"<<endl
;
369 cout
<< "!= " << val
<< endl
<< "-----"<<endl
;
371 cout
<< ">= " << val
<< endl
<< "-----"<<endl
;
373 cout
<< "<= " << val
<< endl
<< "-----"<<endl
;
375 cout
<< "< " << val
<< endl
<< "-----"<<endl
;
377 cout
<< "> " << val
<< endl
<< "-----"<<endl
;
380 cout
<< "lsh " << three
;
382 cout
<< "rsh " << three
;
385 cout
<< " = "<< three
;
387 cout
<< " += "<< three
;
390 cout
<< "! " << val
<< endl
<< "-----"<<endl
;
392 cout
<< "+ " << three
;
394 cout
<< "- " << three
;
396 cout
<< " ~" << three
;
398 cout
<< "postinc " << three
;
400 cout
<< "postdec " << three
;
403 cout
<< "predec " << three
;
405 cout
<< "preinc " << three
;