1 /* This test script is part of GDB, the GNU debugger.
3 Copyright 1999, 2002, 2003, 2004, 2005, 2006, 2007
4 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 friend ostream& operator<<(ostream& outs, A1 one);
44 A1 operator+=(int value);
45 A1 operator+(const A1&);
46 A1 operator-(const A1&);
47 A1 operator%(const A1&);
48 int operator==(const A1&);
49 int operator!=(const A1&);
50 int operator&&(const A1&);
51 int operator||(const A1&);
54 A1 operator|(const A1&);
55 A1 operator^(const A1&);
56 A1 operator&(const A1&);
57 int operator<(const A1&);
58 int operator<=(const A1&);
59 int operator>=(const A1&);
60 int operator>(const A1&);
61 A1 operator*(const A1&);
62 A1 operator/(const A1&);
63 A1 operator=(const A1&);
77 A1 A1::operator+(const A1& second)
86 A1 A1::operator*(const A1& second)
89 product.x = this->x * second.x;
90 product.y = this->y * second.y;
95 A1 A1::operator-(const A1& second)
98 diff.x = x - second.x;
99 diff.y = y - second.y;
104 A1 A1::operator/(const A1& second)
107 div.x = x / second.x;
108 div.y = y / second.y;
113 A1 A1::operator%(const A1& second)
116 rem.x = x % second.x;
117 rem.y = y % second.y;
122 int A1::operator==(const A1& second)
124 int a = (x == second.x);
125 int b = (y == second.y);
130 int A1::operator!=(const A1& second)
132 int a = (x != second.x);
133 int b = (y != second.y);
138 int A1::operator&&(const A1& second)
140 return ( x && second.x);
143 int A1::operator||(const A1& second)
145 return ( x || second.x);
148 A1 A1::operator<<(int value)
151 lshft.x = x << value;
152 lshft.y = y << value;
157 A1 A1::operator>>(int value)
160 rshft.x = x >> value;
161 rshft.y = y >> value;
166 A1 A1::operator|(const A1& second)
169 abitor.x = x | second.x;
170 abitor.y = y | second.y;
175 A1 A1::operator^(const A1& second)
178 axor.x = x ^ second.x;
179 axor.y = y ^ second.y;
184 A1 A1::operator&(const A1& second)
187 abitand.x = x & second.x;
188 abitand.y = y & second.y;
193 int A1::operator<(const A1& second)
197 return (x < second.x);
200 int A1::operator<=(const A1& second)
202 return (x <= second.x);
205 int A1::operator>=(const A1& second)
207 return (x >= second.x);
210 int A1::operator>(const A1& second)
212 return (x > second.x);
215 int A1::operator!(void)
220 A1 A1::operator-(void)
229 A1 A1::operator+(void)
238 A1 A1::operator~(void)
247 A1 A1::operator++() // pre increment
254 A1 A1::operator++(int) // post increment
261 A1 A1::operator--() // pre decrement
268 A1 A1::operator--(int) // post decrement
276 A1 A1::operator=(const A1& second)
285 A1 A1::operator+=(int value)
294 ostream& operator<<(ostream& outs, A1 one)
296 return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl);
320 Member& operator* ();
323 Member& Container::operator* ()
336 marker1(); // marker1-returns-here
337 cout << one; // marker1-returns-here
340 cout << "+ " << three;
342 cout << "- " << three;
344 cout <<"* " << three;
346 cout << "/ " << three;
348 cout << "% " << three;
350 cout << "| " <<three;
352 cout << "^ " <<three;
354 cout << "& "<< three;
357 cout << "&& " << val << endl << "-----"<<endl;
359 cout << "|| " << val << endl << "-----"<<endl;
361 cout << " == " << val << endl << "-----"<<endl;
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;
374 cout << "lsh " << three;
376 cout << "rsh " << three;
379 cout << " = "<< three;
381 cout << " += "<< three;
384 cout << "! " << val << endl << "-----"<<endl;
386 cout << "+ " << three;
388 cout << "- " << three;
390 cout << " ~" << three;
392 cout << "postinc " << three;
394 cout << "postdec " << three;
397 cout << "predec " << three;
399 cout << "preinc " << three;