Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/fold-compare.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 struct ExtentsBase {
5 ExtentsBase() : startx_(), endx_() { }
6 ExtentsBase(const ExtentsBase &b) {
7 *this = b;
8 }
9
10 const ExtentsBase & operator=(const ExtentsBase &b) {
11 if (this != &b) {
12 startx_ = b.startx_;
13 }
14 return *this;
15 }
16
17 int startx_;
18 int endx_;
19 };
20
21 int f(const ExtentsBase &e1) {
22 ExtentsBase my_extents = e1;
23 return my_extents.startx_;
24 }
25
26 /* { dg-final { scan-tree-dump-not "&my_extents" "optimized" } } */
27