Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / opt / const3.C
blobc7c0a1645de77e1eb743842d656d2e482b1da364
1 // PR optimization/12926
2 // This failed on SPARC64 because the assignments to the bit-fields
3 // were wrongly swapped in the constructor.
5 // { dg-do run }
6 // { dg-options "-O2" }
8 extern "C" void abort(void);
10 typedef __SIZE_TYPE__ size_t;
12 void *my_out;
14 struct A
16   enum Type {P, U, S};
18   int foo1(void *, const char *);
19   int foo2(int, const Type);
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   }
27   const size_t mSize : 8*sizeof(size_t) - 3;
28   Type mType : 2;
31 int i;
33 int A::foo1(void *ios, const char *str) { }
34 int A::foo2(int v, const Type t) { i=0; }
36 int main()
38   A testa(2, A::S);
40   if (testa.mType != A::S)
41      abort();
43   return 0;