summaryrefslogtreecommitdiff
path: root/test.toc
blob: e7808febea160d5f010fa006f1cdc699b890e0a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
puti @= fn(x: int) {
	 #C("printf(\"%ld\\n\", (long)x);
");
};

total @= fn() int {
	  t := 0;
	 x := new(int,10);
	 i := 0;
	 while i < x.len {
		   x[i] = i;
		   i = i + 1;
	 }
	 
	 x.len = 5;
	 i = 0;
	 while i < x.len {
	 	   t = t + x[i];
		   i = i + 1;
	 }
	 t
};

// Foo @= struct {
// 	x: &Bar;
// };

// Bar @= struct {
// 	y : &Foo;
// };


main @= fn() {
	 // f: Foo;
	 
	 puti(total());
	 X @= total();
	 puti(X);
	 puti(#sizeof(int));
	 puti(#alignof(int));
};