Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / builtins / lib / strstr.c
blobd803f1ee94bf7812dee00dc5de9d38f905cc7148
1 extern void abort (void);
2 extern int inside_main;
4 char *
5 strstr(const char *s1, const char *s2)
7 const char *p, *q;
9 #ifdef __OPTIMIZE__
10 if (inside_main)
11 abort ();
12 #endif
14 /* deliberately dumb algorithm */
15 for (; *s1; s1++)
17 p = s1, q = s2;
18 while (*q && *p)
20 if (*q != *p)
21 break;
22 p++, q++;
24 if (*q == 0)
25 return (char *)s1;
27 return 0;