about summary refs log tree commit diff
path: root/boot/tests/lower/structural_dedup.cskt
diff options
context:
space:
mode:
Diffstat (limited to 'boot/tests/lower/structural_dedup.cskt')
-rw-r--r--boot/tests/lower/structural_dedup.cskt29
1 files changed, 29 insertions, 0 deletions
diff --git a/boot/tests/lower/structural_dedup.cskt b/boot/tests/lower/structural_dedup.cskt
new file mode 100644
index 0000000..ee4bcd3
--- /dev/null
+++ b/boot/tests/lower/structural_dedup.cskt
@@ -0,0 +1,29 @@
+two functions taking the same anonymous tuple type produce just
+one synthesized type entry.
+
+<<<
+
+f = fun (a (int, int)) int { return 0 }
+g = fun (b (int, int)) int { return 0 }
+
+>>>
+
+(unit
+	(types
+		(type 0 int primitive)
+		(type 1 uint primitive)
+		(type 2 bool primitive)
+		(type 3 string primitive)
+		(type 4 float primitive)
+		(type 5 byte primitive)
+		(type 6 ascii primitive)
+		(type 7 void primitive)
+		(type 8 __cat_type_0 synthetic structure (field _0 (ref int)) (field _1 (ref int)) (depends_on 0 0)))
+	(functions
+		(function 0 f (returns (ref int)) (param a (ref __cat_type_0)) (block
+			(return (expr 0))
+		))
+		(function 1 g (returns (ref int)) (param b (ref __cat_type_0)) (block
+			(return (expr 0))
+		)))
+	(emission_order 0 1 2 3 4 5 6 7 8))