1 /* Copyright (C) 2000 Free Software Foundation.
3 Ensure all expected transformations of builtin strstr occur and
6 Written by Kaveh R. Ghazi, 11/6/2000. */
8 extern void abort(void);
9 extern char *strstr (const char *, const char *);
14 const char *const foo
= "hello world";
16 if (strstr (foo
, "") != foo
)
18 if (strstr (foo
+ 4, "") != foo
+ 4)
20 if (strstr (foo
, "h") != foo
)
22 if (strstr (foo
, "w") != foo
+ 6)
24 if (strstr (foo
+ 6, "o") != foo
+ 7)
26 if (strstr (foo
+ 1, "world") != foo
+ 6)
29 /* Test at least one instance of the __builtin_ style. We do this
30 to ensure that it works and that the prototype is correct. */
31 if (__builtin_strstr (foo
+ 1, "world") != foo
+ 6)