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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [bitfield2.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/13371
2
// Bug: We were failing to properly protect the lhs on the line marked
3
// "here" from multiple evaluation.
4
 
5
// { dg-do run }
6
 
7
extern "C" int printf (const char *, ...);
8
 
9
enum E { E1, E2 };
10
 
11
struct A
12
{
13
  E e : 8;
14
  unsigned char c;
15
};
16
 
17
A ar[2];
18
 
19
int c;
20
 
21
int f()
22
{
23
  ++c;
24
  printf ("f()\n");
25
  return 0;
26
}
27
 
28
int main()
29
{
30
  ar[0].c = 0xff;
31
  ar[f()].e = E1;               // here
32
  return (c != 1 || ar[0].c != 0xff);
33
}

powered by: WebSVN 2.1.0

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