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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass45-frag.c] - Blame information for rev 764

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

Line No. Rev Author Line
1 738 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
#include <string.h>
4
 
5
extern void h (const char *p, const char *f);
6
int
7
main (void)
8
{
9
  h (0, "foo");
10
  return 0;
11
}
12
 
13
void
14
h (const char *p, const char *f)
15
{
16
  size_t pl = p == NULL ? 0 : strlen (p);
17
  size_t fl = strlen (f) + 1;
18
  char a[pl + 1 + fl];
19
  char *cp = a;
20
  char b[pl + 5 + fl * 2];
21
  char *cccp = b;
22
  if (p != NULL)
23
    {
24
      cp = memcpy (cp, p, pl);
25
      *cp++ = ':';
26
    }
27
  memcpy (cp, f, fl);
28
  strcpy (b, a);
29
  puts (a);
30
}
31
/* { dg-output "foo" } */

powered by: WebSVN 2.1.0

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