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] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// Testcase for uses of bool.
// Testcase for uses of bool.
int i,j,k;
int i,j,k;
/* Check that types of certain expressions are bool.  */
/* Check that types of certain expressions are bool.  */
void f ()
void f ()
{
{
  i ? j == k : true;
  i ? j == k : true;
  i ? j < k : true;
  i ? j < k : true;
  i ? j && k : true;
  i ? j && k : true;
}
}
/* Check that g++ can find a conversion to bool when one exists.  */
/* Check that g++ can find a conversion to bool when one exists.  */
struct A { operator char * (); } a;
struct A { operator char * (); } a;
struct B { operator int (); } b;
struct B { operator int (); } b;
struct C { operator float (); } c;
struct C { operator float (); } c;
struct D { operator bool (); } d;
struct D { operator bool (); } d;
struct E { operator int E::* (); } e;
struct E { operator int E::* (); } e;
void g ()
void g ()
{
{
  a || true;
  a || true;
  b || true;
  b || true;
  c || true;                    // { dg-bogus "" }
  c || true;                    // { dg-bogus "" }
  d || true;
  d || true;
  e || true;
  e || true;
}
}
/* Check for support in templates.  */
/* Check for support in templates.  */
template  struct F { };
template  struct F { };
template class F;
template class F;
template  void f (T, bool) { }
template  void f (T, bool) { }
template void f (bool, bool);
template void f (bool, bool);
/* Special cases.  */
/* Special cases.  */
void h ()
void h ()
{
{
  /* Used to cause infinite recursion.  */
  /* Used to cause infinite recursion.  */
  i&1 || true;
  i&1 || true;
  /* Should find conversion path to int.  */
  /* Should find conversion path to int.  */
  d == true;
  d == true;
}
}
bool boo = -1;
bool boo = -1;
 
 

powered by: WebSVN 2.1.0

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