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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [init/] [bitfield1.C] - Diff between revs 154 and 816

Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
// Check that we handle bitfields as complex lvalues properly.
// Check that we handle bitfields as complex lvalues properly.
struct A
struct A
{
{
  int i: 2;
  int i: 2;
  int j: 2;
  int j: 2;
  int k: 2;
  int k: 2;
};
};
A a, a2;
A a, a2;
bool b;
bool b;
void f ();
void f ();
int main ()
int main ()
{
{
  (f(), a.j) = 1;
  (f(), a.j) = 1;
  (f(), a).j = 2; // { dg-warning "overflow" }
  (f(), a).j = 2; // { dg-warning "overflow" }
  (b ? a.j : a2.k) = 3; // { dg-warning "overflow" }
  (b ? a.j : a2.k) = 3; // { dg-warning "overflow" }
  (b ? a : a2).j = 0;
  (b ? a : a2).j = 0;
  ++(a.j) = 1;
  ++(a.j) = 1;
  (a.j = 2) = 3; // { dg-warning "overflow" }
  (a.j = 2) = 3; // { dg-warning "overflow" }
}
}
 
 

powered by: WebSVN 2.1.0

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