OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [20000807-1.c] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2
/* { dg-options "-Os -fpic" } */
3
 
4
#include <string.h>
5
 
6
typedef struct
7
{
8
  char *a;
9
  char *b;
10
} *foo;
11
 
12
void
13
bar (foo x)
14
{
15
  char *c = x->b;
16
  char *d = (void *)0;
17
  unsigned int e = 0, f = 0, g;
18
  while (*c != ':')
19
    if (*c == '%')
20
      {
21
        ++c;
22
        switch (*c++)
23
          {
24
          case 'N':
25
            g = strlen (x->a);
26
            if (e + g >= f) {
27
                char *h = d;
28
                f += 256 + g;
29
                d = (char *) __builtin_alloca (f);
30
                memcpy (d, h, e);
31
            };
32
            memcpy (&d[e], x->a, g);
33
            e += g;
34
            break;
35
          }
36
      }
37
}

powered by: WebSVN 2.1.0

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