Blame src/thread/tls_align.c

nsz 462b4f
#include <stddef.h>
nsz 462b4f
#include "test.h"
nsz 462b4f
nsz 462b4f
extern struct {
nsz 462b4f
	char *name;
nsz 462b4f
	size_t size;
nsz 462b4f
	size_t align;
nsz 462b4f
	size_t addr;
nsz 462b4f
} t[4];
nsz 462b4f
nsz 462b4f
int main()
nsz 462b4f
{
nsz 462b4f
	int i;
nsz 462b4f
nsz 462b4f
	for (i = 0; i < sizeof t/sizeof *t; i++) {
nsz 462b4f
		if (!t[i].name)
nsz 462b4f
			error("name is not set for t[%d]\n", i);
nsz 462b4f
		if (t[i].addr & (t[i].align-1))
nsz 462b4f
			error("bad alignment: %s, size: %u, align: %u, addr: 0x%lx\n",
nsz 462b4f
				t[i].name, (unsigned)t[i].size, (unsigned)t[i].align, (unsigned long)t[i].addr);
nsz 462b4f
	}
nsz 462b4f
	return test_status;
nsz 462b4f
}