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