Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.jason / groff1.C
blob636317956fbe801834a8b4187d97c6b63e472c6b
1 // { dg-do run  }
2 // PRMS Id: 3744
3 // Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the
4 // result, so expand_expr ignores it.
6 extern "C" {
7   int printf(const char *,...);
8   void exit(int);
11 struct A {
12   int x;
13   int y;
15   A() : x(0), y(0) { }
18 struct S {
19   S() : flags(0) { }
20   unsigned flags;
21   A from;
22   void foo(const A &pos);
25 void S::foo(const A &pos)
27   A a = flags ? from : pos;
28   printf("%d %d\n", a.x, a.y);
29   if (a.x != 17 || a.y != 12)
30     exit (1);
33 int main()
35   A pos;
36   pos.x = 17;
37   pos.y = 12;
38   S s;
39   s.foo(pos);
40   return 0;