aboutsummaryrefslogtreecommitdiff
path: root/tests/lxdrgen.lxdr
blob: d33233657fa8a43583a076046fd91dccfe07d89a (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
/*
 * tests/lxdrgen.lxdr: a test protocol for the generator
 */
const VERSION = 1;
const NOISREV = -1;

// TODO: Test failure paths, and in general go for full coverage.
struct Struct {
	union Union switch (enum Enum {
		NUMBERS = VERSION,
		OTHERS = 2,
		NOTHING,
	} tag) {
	case NUMBERS:
		i8 a; i16 b; i32 c; i64 d;
		u8 e; u16 f; u32 g; u64 h;
	case OTHERS:
		bool foo;
		string bar;
		u8 baz<>;
	case NOTHING:
		void;
	} u<>;

	union Onion switch (Enum tag) {
	case NOTHING:
		void;
	} o;
};