OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [builtins/] [strstr.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* Copyright (C) 2000  Free Software Foundation.
2
 
3
   Ensure all expected transformations of builtin strstr occur and
4
   perform correctly.
5
 
6
   Written by Kaveh R. Ghazi, 11/6/2000.  */
7
 
8
extern void abort(void);
9
extern char *strstr (const char *, const char *);
10
 
11
void
12
main_test (void)
13
{
14
  const char *const foo = "hello world";
15
 
16
  if (strstr (foo, "") != foo)
17
    abort();
18
  if (strstr (foo + 4, "") != foo + 4)
19
    abort();
20
  if (strstr (foo, "h") != foo)
21
    abort();
22
  if (strstr (foo, "w") != foo + 6)
23
    abort();
24
  if (strstr (foo + 6, "o") != foo + 7)
25
    abort();
26
  if (strstr (foo + 1, "world") != foo + 6)
27
    abort();
28
 
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)
32
    abort();
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.