Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / fold-compare.C
blob88367a2bff564d53b47de581af8ea9950c03354e
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 struct ExtentsBase {
5  ExtentsBase() : startx_(), endx_() { }
6  ExtentsBase(const ExtentsBase &b) {
7   *this = b;
8  }
10  const ExtentsBase & operator=(const ExtentsBase &b) {
11   if (this != &b) {
12     startx_ = b.startx_;
13   }
14   return *this;
15  }
17  int startx_;
18   int endx_;
21 int f(const ExtentsBase &e1) {
22  ExtentsBase my_extents = e1;
23  return my_extents.startx_;
26 /* { dg-final { scan-tree-dump-not "&my_extents" "optimized" } } */