import gdb-1999-06-28 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / call-strs.c
CommitLineData
c906108c 1#include <stdio.h>
085dd6e6
JM
2#include <stdlib.h>
3#include <string.h>
4
c906108c
SS
5char buf[100];
6char bigbuf[1000];
7char * s;
8
085dd6e6
JM
9#ifdef PROTOTYPES
10char * str_func1(char *s1)
11#else
c906108c
SS
12char * str_func1(s1)
13char *s1;
085dd6e6 14#endif
c906108c
SS
15{
16 printf("first string arg is: %s\n", s1);
17 strcpy(bigbuf, s1);
18 return bigbuf;
19}
20
085dd6e6
JM
21#ifdef PROTOTYPES
22char * str_func(
23char * s1,
24char * s2,
25char * s3,
26char * s4,
27char * s5,
28char * s6,
29char * s7)
30#else
c906108c
SS
31char * str_func(s1,
32 s2,
33 s3,
34 s4,
35 s5,
36 s6,
37 s7)
38char * s1;
39char * s2;
40char * s3;
41char * s4;
42char * s5;
43char * s6;
44char * s7;
085dd6e6 45#endif
c906108c
SS
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
0f71a2f6
JM
64char *
65link_malloc ()
66{
67 return (char*) malloc (1);
68}
c906108c 69
085dd6e6 70int main()
c906108c
SS
71{
72 s = &buf[0];
73 strcpy(buf, "test string");
74 str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12");
75 str_func1("abcd");
085dd6e6 76 return 0;
c906108c
SS
77}
78
This page took 0.039658 seconds and 4 git commands to generate.