Merge from mainline
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr17697-2.C
blob4a746be3d01e82e7df123887de0398592009d709
1 // PR tree-optimization/17697
2 // { dg-do run }
3 // { dg-options "-O2" }
5 extern "C"
7   extern int strcmp (const char *s, const char *t) throw ()
8     __attribute__ ((pure));
11 namespace A
13   extern int strcmp (const char *s, const char *t) throw ();
16 inline int
17 A::strcmp (const char *s, const char *t) throw ()
19   return ::strcmp (s, t);
22 int
23 foo (const char *x) throw ()
25   return A::strcmp ("", x);
28 int
29 main ()
31   return foo ("") != 0 || foo ("a") == 0;