Debian Codegraph @

gcc/testsuite/g++.dg/tree-ssa/pr8781.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fno-tree-sra -fdump-tree-fre1 --param early-inlining-insns=14" } */
3
4 int f();
5
6 template<typename predicate>
7 class noop_t {
8 const predicate &pred;
9 public:
10 explicit noop_t(const predicate &p) : pred(p) {}
11
12 int operator()() const { return pred(); }
13 };
14
15 template<typename predicate>
16 inline noop_t<predicate> noop(const predicate &pred) {
17 return noop_t<predicate>(pred);
18 }
19
20 int x()
21 {
22 return (noop(noop(noop(noop(noop(noop(noop(noop(noop(f)))))))))());
23 }
24
25 /* We should optimize this to a direct call. */
26
27 /* { dg-final { scan-tree-dump-times "= f \\(\\);" 1 "fre1" } } */