Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr30965.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-ipa-icf -fdump-tree-optimized" } */
3 /* { dg-skip-if "requires hosted libstdc++ for tr1/functional" { ! hostedlib } } */
4
5 #include <tr1/functional>
6 #include <algorithm>
7
8 extern void assign( long* variable, long v )
9 {
10 std::transform( variable, variable + 1, variable,
11 std::tr1::bind( std::plus< long >(), 0L, v ) );
12 }
13 extern void assign( long& variable, long v )
14 {
15 std::transform( &variable, &variable + 1, &variable,
16 std::tr1::bind( std::plus< long >(), 0L, v ) );
17 }
18
19 /* { dg-final { scan-tree-dump-times ";; Function" 2 "optimized" } } */
20 /* { dg-final { scan-tree-dump-times "variable_..D. = v_..D." 2 "optimized" } } */