Index: src/tests/.expect/tupleAssign.txt
===================================================================
--- src/tests/.expect/tupleAssign.txt	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/.expect/tupleAssign.txt	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,6 @@
+u=5 v=6 x=10 y=11 z=[100, 200]
+u=11 v=10 x=11 y=10 z=[11, 10]
+u=10 v=11 z=[10, 11]
+u=123 v=456 z=[111, 222]
+d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153]
+d=-2153.12 i=-2153 c=-105 t=[-2153, -2153.12, -2153]
Index: src/tests/.expect/tupleFunction.txt
===================================================================
--- src/tests/.expect/tupleFunction.txt	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/.expect/tupleFunction.txt	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,12 @@
+foo([123, 456, 999.123, {321, 654, Q, 3.14}])
+a=123 b=456 c=999.123 d={321, 654, Q, 3.14}
+X=[123, 456, 999.123, {321, 654, Q, 3.14}]
+foo(...)=456
+bar([777, 2.76, 8675])
+bar([123, 999.123, 456])
+baz(777, 2.76, 8675)
+baz(123, 999.123, 456)
+qux([777, 2.76], 8675)
+qux([123, 999.123], 456)
+x=[3, 5.254, 4]
+x1=3 x2=5.254 x3=4
Index: src/tests/.expect/tupleMember.txt
===================================================================
--- src/tests/.expect/tupleMember.txt	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/.expect/tupleMember.txt	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,4 @@
+called f!
+g(...)=13.5
+v.[f1, i.[f2, f3], f4]=[12, 11, 13, 3.14159]
+v.[f1, i.[f2, f3], f4]=[4, [987, 2], 6.28]
Index: src/tests/tupleAssign.c
===================================================================
--- src/tests/tupleAssign.c	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/tupleAssign.c	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,40 @@
+int main() {
+	{
+		// test multiple assignment and cascading assignment
+		int u = 5, v = 6, x = 10, y = 11;
+		[int, int] z = [100, 200];
+
+		// swap x, y and store the new [x, y] in [u, v] and in z;
+		printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z);
+		z = [u, v] = [x, y] = [y, x];
+		printf("u=%d v=%d x=%d y=%d z=[%d, %d]\n", u, v, x, y, z);
+
+		// shuffle elements -- v = z.0, z.0 = z.1, z.1 = u, u = v
+		[v, z, u] = [z, u, v];
+		printf("u=%d v=%d z=[%d, %d]\n", u, v, z);
+
+		// multiple assignment with tuple expression on right
+		z = [111, 222];
+		[u, v] = [123, 456];
+		printf("u=%d v=%d z=[%d, %d]\n", u, v, z);
+	}
+
+	{
+		// test mass assignment
+		double d = 0.0;
+		int i = 0;
+		char c = '\0';
+		struct X {
+			int z;
+		} x;
+		X ?=?(X * x, double d) {}
+		[int, double, int] t;
+
+		// no conversion from X to integral types, so this serves as a santiy
+		// check that as long as this compiles, ?=?(_, x) is not generated.
+		[t, x, d, i, c, x] = (double)-2153.12;
+		printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t);
+		[x, c, i, d, x, t] = (double)-2153.12;
+		printf("d=%lg i=%d c=%d t=[%d, %lg, %d]\n", d, i, (int)c, t);
+	}
+}
Index: src/tests/tupleFunction.c
===================================================================
--- src/tests/tupleFunction.c	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/tupleFunction.c	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,78 @@
+struct S {
+	int f1, f2;
+	char f3;
+	double f4;
+} v;
+
+[int] foo( [int, int, double, S] x ) {
+	printf("foo([%d, %d, %lg, {%d, %d, %c, %lg}])\n", x.0, x.1, x.2, x.3.[f1, f2, f3, f4]);
+	int a, b;
+	double c;
+	S d;
+	[a, b, c, d] = x;
+	[int, int, double, S] X = x;
+	printf("a=%d b=%d c=%lg d={%d, %d, %c, %lg}\n", a, b, c, d.[f1, f2, f3, f4]);
+	printf("X=[%d, %d, %lg, {%d, %d, %c, %lg}]\n", X.0, X.1, X.2, X.3.[f1, f2, f3, f4]);
+	return b;
+}
+
+[void] bar( [int, double, int] z ) {
+	printf("bar([%d, %lg, %d])\n", z);
+}
+
+[void] baz( int a, double b, int c ) {
+	printf("baz(%d, %lg, %d)\n", a, b, c);
+}
+
+[void] qux( [int, double] n, int m ) {
+	printf("qux([%d, %lg], %d)\n", n, m);
+}
+
+[int, double x, int] quux() {
+	return [3, 5.254, 4];
+}
+[[[int, double, int], [int, double]]] quuux() {
+	return [1, 2, 3, 4, 5];
+}
+
+// forall(otype T | { T ?+?(T, T); })
+// [T, T, T] ?+?([T, T, T] x, [T, T, T] y) {
+// 	T x1, x2, x3, y1, y2, y3;
+// 	[x1, x2, x3] = x;
+// 	[y1, y2, y3] = y;
+// 	return [x1+y1, x2+y2, x3+y3];
+// }
+
+int main() {
+  [int, double, int] x = [777, 2.76, 8675];
+  int x1 = 123, x3 = 456;
+  double x2 = 999.123;
+
+  printf("foo(...)=%d\n", foo(x1, x3, x2, (S){ 321, 654, 'Q', 3.14 }));
+
+	// call function with tuple parameter using tuple variable arg
+	bar(x);
+
+	// call function with tuple parameter using multiple values
+	bar(x1, x2, x3);
+
+	// call function with multiple parameters using tuple variable arg
+	baz(x);
+
+	// call function with multiple parameters using multiple args
+	baz(x1, x2, x3);
+
+	// call function with multiple parameters, one of which is a tuple using tuple variable arg
+	qux(x);
+
+	// call function with multiple parameters, one of which is a tuple using multiple args
+	qux(x1, x2, x3);
+
+	// call function with multiple return values and assign into a tuple variable
+	x = quux();
+	printf("x=[%d, %lg, %d]\n", x);
+
+	// call function with multiple return values and assign into a tuple expression
+	[x1, x2, x3] = quux();
+	printf("x1=%d x2=%lg x3=%d\n", x1, x2, x3);
+}
Index: src/tests/tupleMember.c
===================================================================
--- src/tests/tupleMember.c	(revision dc86541addcdbd373e273d51807199c866110439)
+++ src/tests/tupleMember.c	(revision dc86541addcdbd373e273d51807199c866110439)
@@ -0,0 +1,42 @@
+void f() {
+	printf("called f!\n");
+}
+
+double g(double x, char y, int z) {
+	return z-y+x;
+}
+
+struct V2	{
+	int f2, f3;
+};
+struct V {
+	int f1;
+	V2 i; // temporary
+	// struct V2 {
+	//   int f2, f3;
+	// } i;
+	double f4;
+} v;
+
+lvalue V h() {
+	static V local = { 111, { 222, 333 }, 444.5 };
+	return local;
+}
+
+int main() {
+	struct X {
+		int a;
+		double b;
+		char c;
+	} x = { 10, 12.5, '\x9' };
+
+	// should only call f once
+	printf("g(...)=%lg\n", g((f(), x).[b, c, a]));
+
+	v.[f1, i.[f2, f3], f4].[1.0, 2, 0, 1.1] = [11, 3.14159, 12, 13];
+
+	printf("v.[f1, i.[f2, f3], f4]=[%d, %d, %d, %lg]\n", v.[f1, i.[f2, f3], f4]);
+
+	h().[f1, i.[f2, f3], f4].[1.0, 2, 0, 1.1] = [987, 6.28, 4, 2];
+	printf("v.[f1, i.[f2, f3], f4]=[%d, [%d, %d], %lg]\n", h().[f1, i.[f2, f3], f4]);
+}
