2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / pr34029-1.c
blob526112974b27fb1da6171998b44258f87c629a2b
1 static const char s[] = "ab.cd.efghijk";
3 int
4 foo (const char *x)
6 const char *a;
7 int b = 0;
9 a = __builtin_strchr (s, '.');
10 if (a == 0)
11 b = 1;
12 else if ((a = __builtin_strchr (a + 1, '.')) == 0)
13 b = 1;
14 else if (__builtin_strncmp (s, x, a - s))
15 b = 1;
16 else if (__builtin_strncmp (a + 1, x + (a - s + 1), 4) < 0)
17 b = 1;
19 if (b)
20 return 4;
21 return 0;