URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
|
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
|
/* { dg-options "-Os -fpic" } */
|
/* { dg-options "-Os -fpic" } */
|
|
|
#include <string.h>
|
#include <string.h>
|
|
|
typedef struct
|
typedef struct
|
{
|
{
|
char *a;
|
char *a;
|
char *b;
|
char *b;
|
} *foo;
|
} *foo;
|
|
|
void
|
void
|
bar (foo x)
|
bar (foo x)
|
{
|
{
|
char *c = x->b;
|
char *c = x->b;
|
char *d = (void *)0;
|
char *d = (void *)0;
|
unsigned int e = 0, f = 0, g;
|
unsigned int e = 0, f = 0, g;
|
while (*c != ':')
|
while (*c != ':')
|
if (*c == '%')
|
if (*c == '%')
|
{
|
{
|
++c;
|
++c;
|
switch (*c++)
|
switch (*c++)
|
{
|
{
|
case 'N':
|
case 'N':
|
g = strlen (x->a);
|
g = strlen (x->a);
|
if (e + g >= f) {
|
if (e + g >= f) {
|
char *h = d;
|
char *h = d;
|
f += 256 + g;
|
f += 256 + g;
|
d = (char *) __builtin_alloca (f);
|
d = (char *) __builtin_alloca (f);
|
memcpy (d, h, e);
|
memcpy (d, h, e);
|
};
|
};
|
memcpy (&d[e], x->a, g);
|
memcpy (&d[e], x->a, g);
|
e += g;
|
e += g;
|
break;
|
break;
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.