gcc/testsuite/g++.dg/opt/pr17697-3.C
raw| 1 | // PR tree-optimization/17697 |
| 2 | // { dg-do run } |
| 3 | // { dg-options "-O2" } |
| 4 | |
| 5 | extern "C" int strcmp (const char *s, const char *t); |
| 6 | |
| 7 | namespace A |
| 8 | { |
| 9 | extern int strcmp (const char *s, const char *t); |
| 10 | } |
| 11 | |
| 12 | inline int |
| 13 | A::strcmp (const char *s, const char *t) |
| 14 | { |
| 15 | return ::strcmp (s, t); |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | foo (const char *x) |
| 20 | { |
| 21 | return A::strcmp ("", x); |
| 22 | } |
| 23 | |
| 24 | int |
| 25 | main () |
| 26 | { |
| 27 | return foo ("") != 0 || foo ("a") == 0; |
| 28 | } |