OSDN Git Service

PR c++/34774
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / opt / pr17697-1.C
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);
14 }
15
16 inline int
17 A::strcmp (const char *s, const char *t)
18 {
19   return ::strcmp (s, t);
20 }
21
22 int
23 foo (const char *x) throw ()
24 {
25   return A::strcmp ("", x);
26 }
27
28 int
29 main ()
30 {
31   return foo ("") != 0 || foo ("a") == 0;
32 }