~lbnz/xr0

6eb503b11fd2eb69059052bcf8f2a4f6911ed59d — Xr0 Team 5 months ago 8185bc3 feat/linking
checkpoint
2 files changed, 24 insertions(+), 1 deletions(-)

M src/0v/main.c
A tests/4-linking/050-multiple-prototype.x
M src/0v/main.c => src/0v/main.c +0 -1
@@ 192,7 192,6 @@ pass1(struct ast *root, struct externals *ext)
	for (int i = 0; i < root->n; i++) {
		struct ast_externdecl *decl = root->decl[i];
		if (!ast_externdecl_isfunction(decl)) {
			ast_externdecl_install(decl, ext);
			continue;
		}
		struct ast_function *f = ast_externdecl_as_function(decl);

A tests/4-linking/050-multiple-prototype.x => tests/4-linking/050-multiple-prototype.x +24 -0
@@ 0,0 1,24 @@
#include <stdlib.h>

void *
allocating() ~ [ .alloc result; ];

void *
nonallocating();

void *
allocating()
{
	void *p;
	void *q;

	p = malloc(1);
	q = nonallocating();
	return p;
}

void *
nonallocating()
{
	return NULL;
}