aboutsummaryrefslogtreecommitdiff
path: root/tests/unions.cu
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-04-03 16:00:34 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-04-03 16:00:34 +0300
commit2ca159fb5c2a52f33c499eef1fa50a98a863b0f0 (patch)
treec9497ad8372a047bcff366c189c8969ed84f0406 /tests/unions.cu
parent4642bedb436981e92e3312f06bfcb2eb34074596 (diff)
downloadek-2ca159fb5c2a52f33c499eef1fa50a98a863b0f0.tar.gz
ek-2ca159fb5c2a52f33c499eef1fa50a98a863b0f0.zip
initial union testing
Diffstat (limited to 'tests/unions.cu')
-rw-r--r--tests/unions.cu23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/unions.cu b/tests/unions.cu
new file mode 100644
index 0000000..6c3edc5
--- /dev/null
+++ b/tests/unions.cu
@@ -0,0 +1,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);
+}