gcc/testsuite/g++.dg/tree-ssa/pr87502.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-additional-options "-O2 -fdump-tree-optimized" } |
| 3 | #include <string> |
| 4 | |
| 5 | |
| 6 | __attribute__ ((pure)) |
| 7 | extern int foo (const std::string &); |
| 8 | |
| 9 | int |
| 10 | bar () |
| 11 | { |
| 12 | return foo ("abc") + foo (std::string("abc")); |
| 13 | } |
| 14 | // We used to add terminating zero explicitely instead of using fact |
| 15 | // that memcpy source is already 0 terminated. |