OSDN Git Service

59e3c9bc9b4009486cf817bba5ef3ce160939b84
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / tree-ssa / pr14814.C
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-forwprop2" } */
3
4 class YY { public:
5   YY(const YY &v) { e[0] = v.e[0]; e[1] = v.e[1]; e[2] = v.e[2]; }
6   double &y() { return e[1]; }
7   double e[3];  };
8
9 class XX { public:
10   YY direction() const { return v; }
11   YY v;  };
12
13 int foo(XX& r) {
14   if (r.direction().y() < 0.000001) return 0;
15   return 1; }
16
17 /* { dg-final { scan-tree-dump-times "&this" 0 "forwprop2" } } */
18 /* { dg-final { scan-tree-dump-times "&r" 0 "forwprop2" } } */
19 /* { dg-final { cleanup-tree-dump "forwprop2" } } */
20