scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <assert.h>
 2#include <stdio.h>
 3#include <string.h>
 4
 5/*
 6output:
 7testing
 8ok
 9end:
10*/
11
12int
13main(void)
14{
15	char *s, buf[40];
16
17	puts("testing");
18	strcpy(buf, "case1:");
19	s = strcat(buf, "ok");
20	assert(s == buf);
21	assert(!strcmp(s, "case1:ok"));
22
23	strcpy(buf, "");
24	s = strcat(buf, "ok");
25	assert(s == buf);
26	assert(!strcmp(s, "ok"));
27
28	strcpy(buf, "case1:");
29	strcat(buf, "");
30	assert(s == buf);
31	assert(!strcmp(s, "case1:"));
32
33	puts("ok");
34
35	return 0;
36}