OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20100827-1.c
1 extern void abort (void);
2 int __attribute__((noinline,noclone))
3 foo (char *p)
4 {
5   int h = 0;
6   do
7     {
8       if (*p == '\0')
9         break;
10       ++h;
11       if (p == 0)
12         abort ();
13       ++p;
14     }
15   while (1);
16   return h;
17 }
18 int main()
19 {
20   if (foo("a") != 1)
21     abort ();
22   return 0;
23 }