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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.base/] [call-strs.c] - Blame information for rev 227

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

Line No. Rev Author Line
1 227 jeremybenn
#include <stdio.h>
2
#include <stdlib.h>
3
#include <string.h>
4
 
5
char buf[100];
6
char bigbuf[1000];
7
char * s;
8
 
9
#ifdef PROTOTYPES
10
char * str_func1(char *s1)
11
#else
12
char * str_func1(s1)
13
char *s1;
14
#endif
15
{
16
  printf("first string arg is: %s\n", s1);
17
  strcpy(bigbuf, s1);
18
  return bigbuf;
19
}
20
 
21
#ifdef PROTOTYPES
22
char * str_func(
23
char * s1,
24
char * s2,
25
char * s3,
26
char * s4,
27
char * s5,
28
char * s6,
29
char * s7)
30
#else
31
char * str_func(s1,
32
                s2,
33
               s3,
34
               s4,
35
               s5,
36
               s6,
37
               s7)
38
char * s1;
39
char * s2;
40
char * s3;
41
char * s4;
42
char * s5;
43
char * s6;
44
char * s7;
45
#endif
46
{
47
  printf("first string arg is: %s\n", s1);
48
  printf("second string arg is: %s\n", s2);
49
  printf("third string arg is: %s\n", s3);
50
  printf("fourth string arg is: %s\n", s4);
51
  printf("fifth string arg is: %s\n", s5);
52
  printf("sixth string arg is: %s\n", s6);
53
  printf("seventh string arg is: %s\n", s7);
54
  strcpy(bigbuf, s1);
55
  strcat(bigbuf, s2);
56
  strcat(bigbuf, s3);
57
  strcat(bigbuf, s4);
58
  strcat(bigbuf, s5);
59
  strcat(bigbuf, s6);
60
  strcat(bigbuf, s7);
61
  return bigbuf;
62
}
63
 
64
char *
65
link_malloc ()
66
{
67
  return (char*) malloc (1);
68
}
69
 
70
int main()
71
{
72
  s = &buf[0];
73
  strcpy(buf, "test string");
74
  str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12");
75
  str_func1("abcd");
76
  return 0;
77
}
78
 

powered by: WebSVN 2.1.0

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