summaryrefslogtreecommitdiff
path: root/tests/sizeof.toc
blob: 0bc806b291cae8021f960b4e88a3636ec5284fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "io.toc", io;

Point3D ::= struct {
	x, y, z: f32;
}

calculation ::= fn() int {
	p: Point3D;
	(#sizeof Point3D) * (#sizeof typeof p) * (sizeof Point3D) * (sizeof typeof p)
	* (#alignof Point3D) * (#alignof typeof p) * (alignof Point3D) * (alignof typeof p)
}

main ::= fn() {
	x ::= calculation();
	io.puti(x);
	io.puti(calculation());
}