patches/gcc/3.3.2/pr13260-test.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 See http://gcc.gnu.org/PR13260
     2 
     3 /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20031204-1.c,v  -->  standard output
     4 revision 1.1
     5 --- -	1970-01-01 00:00:00.000000000 +0000
     6 +++ gcc/gcc/testsuite/gcc.c-torture/execute/20031204-1.c
     7 @@ -0,0 +1,49 @@
     8 +/* PR optimization/13260 */
     9 +
    10 +#include <string.h>
    11 +
    12 +typedef unsigned long u32;
    13 +
    14 +u32 in_aton(const char* x)
    15 +{
    16 +  return 0x0a0b0c0d;
    17 +}
    18 +
    19 +u32 root_nfs_parse_addr(char *name)
    20 +{
    21 + u32 addr;
    22 + int octets = 0;
    23 + char *cp, *cq;
    24 +
    25 + cp = cq = name;
    26 + while (octets < 4) {
    27 +  while (*cp >= '0' && *cp <= '9')
    28 +   cp++;
    29 +  if (cp == cq || cp - cq > 3)
    30 +   break;
    31 +  if (*cp == '.' || octets == 3)
    32 +   octets++;
    33 +  if (octets < 4)
    34 +   cp++;
    35 +  cq = cp;
    36 + }
    37 +
    38 + if (octets == 4 && (*cp == ':' || *cp == '\0')) {
    39 +  if (*cp == ':')
    40 +   *cp++ = '\0';
    41 +  addr = in_aton(name);
    42 +  strcpy(name, cp);
    43 + } else
    44 +  addr = (-1);
    45 +
    46 + return addr;
    47 +}
    48 +
    49 +int
    50 +main()
    51 +{
    52 +  static char addr[] = "10.11.12.13:/hello";
    53 +  u32 result = root_nfs_parse_addr(addr);
    54 +  if (result != 0x0a0b0c0d) { abort(); }
    55 +  return 0;
    56 +}