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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [const3.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 693 jeremybenn
// PR optimization/12926
2
// This failed on SPARC64 because the assignments to the bit-fields
3
// were wrongly swapped in the constructor.
4
 
5
// { dg-do run }
6
// { dg-options "-O2" }
7
 
8
extern "C" void abort(void);
9
 
10
typedef __SIZE_TYPE__ size_t;
11
 
12
void *my_out;
13
 
14
struct A
15
{
16
  enum Type {P, U, S};
17
 
18
  int foo1(void *, const char *);
19
  int foo2(int, const Type);
20
 
21
  A (const size_t size, const Type type): mSize(size), mType(type)
22
  {
23
      foo2(foo1(my_out, "type = "), type);
24
      foo2(foo1(my_out, "mType = "), mType);
25
  }
26
 
27
  const size_t mSize : 8*sizeof(size_t) - 3;
28
  Type mType : 2;
29
};
30
 
31
int i;
32
 
33
int A::foo1(void *ios, const char *str) { }
34
int A::foo2(int v, const Type t) { i=0; }
35
 
36
int main()
37
{
38
  A testa(2, A::S);
39
 
40
  if (testa.mType != A::S)
41
     abort();
42
 
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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