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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [20000807-1.c] - Blame information for rev 318

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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