1 /* { dg-options "-O2 -fdump-tree-modref1 -fdump-tree-optimized" } */
2 /* { dg-do compile } */
4 __attribute__ ((noinline
))
10 __attribute__ ((noinline
, pure
))
11 int *pure_test (int *b
)
13 return *b
&& c
? &c
: 0;
15 __attribute__ ((noinline
, const))
16 int *const_test (int *b
)
26 escape (pure_test (&a
));
27 escape (const_test (&a
));
30 /* Flags for normal call. */
31 /* { dg-final { scan-tree-dump "parm 0 flags: no_direct_clobber no_indirect_clobber no_direct_escape no_indirect_escape not_returned_directly not_returned_indirectly no_indirect_read" "modref1" } } */
32 /* Flags for pure call. */
33 /* { dg-final { scan-tree-dump "parm 0 flags: not_returned_directly not_returned_indirectly no_indirect_read" "modref1" } } */
34 /* Flags for const call. */
35 /* { dg-final { scan-tree-dump "parm 0 flags: not_returned_directly" "modref1" } } */
36 /* Overall we want to make "int a" non escaping. */
37 /* { dg-final { scan-tree-dump "return 42" "optimized" } } */