source: trunk/testcase/456/boolparam.cpp@ 803

Last change on this file since 803 was 803, checked in by bird, 22 years ago

Initial coding.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1/* $Id: boolparam.cpp 803 2003-10-05 02:55:15Z bird $ */
2/** @file
3 *
4 * GCC does weird stuff in respect to the C++ bool type when passed as
5 * a parameter. In this testcsae we should see the values changing in
6 * variable monitor. The bool variables should be represented as if
7 * enums with values true or false.
8 *
9 * Copyright (c) 2003 knut st. osmundsen <bird-srcspam@anduin.net>
10 *
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with This program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28#ifdef __IBMCPP__
29typedef char bool;
30#define false 0
31#define true 1
32#endif
33
34bool foo(bool f1, bool f2)
35{
36 f1 = true;
37 f1 = false;
38 f2 = false;
39 f2 = true;
40 return f2 && !f1;
41}
42
43
44int main()
45{
46 return !foo(false, true);
47}
Note: See TracBrowser for help on using the repository browser.