aboutsummaryrefslogtreecommitdiff
path: root/tests/unions.cu
blob: 6c3edc57a316fd3d6ac3644fa459a800d90c93c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
typedef any {}

union basic_union {
	a u32;
	b i64;
	c f32;
}

union complex_union(A any, B any, C any) {
	a A;
	b B;
	c C;
}

main()
{
	simple_named const = {.b = 1} as basic_union;
	simple_ordinal const = {1 as u32} as basic_union; 

	// TODO: unions should be fully actualized
	complex_named const = {.b = 1} as complex_union(u32, i64, f32);
	complex_ordinal const = {1 as u32} as complex_union(u32, i64, f32);
}