OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [bool.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// Testcase for uses of bool.
3
 
4
int i,j,k;
5
 
6
/* Check that types of certain expressions are bool.  */
7
void f ()
8
{
9
  i ? j == k : true;
10
  i ? j < k : true;
11
  i ? j && k : true;
12
}
13
 
14
/* Check that g++ can find a conversion to bool when one exists.  */
15
struct A { operator char * (); } a;
16
struct B { operator int (); } b;
17
struct C { operator float (); } c;
18
struct D { operator bool (); } d;
19
struct E { operator int E::* (); } e;
20
 
21
void g ()
22
{
23
  a || true;
24
  b || true;
25
  c || true;                    // { dg-bogus "" }
26
  d || true;
27
  e || true;
28
}
29
 
30
/* Check for support in templates.  */
31
template  struct F { };
32
template class F;
33
 
34
template  void f (T, bool) { }
35
template void f (bool, bool);
36
 
37
/* Special cases.  */
38
void h ()
39
{
40
  /* Used to cause infinite recursion.  */
41
  i&1 || true;
42
  /* Should find conversion path to int.  */
43
  d == true;
44
}
45
 
46
bool boo = -1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.