Index: src/examples/poly-bench.c
===================================================================
--- src/examples/poly-bench.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/examples/poly-bench.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,207 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// poly-bench.cc -- 
+//
+// Author           : Aaron Moss
+// Created On       : Sat May 16 07:26:30 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed May 27 18:25:19 2015
+// Update Count     : 5
+//
+
+extern "C" {
+#include <stdio.h>
+//#include "my_time.h"
+}
+
+#define N 200000000
+
+struct ipoint {
+	int x;
+	int y;
+};
+
+struct ipoint ?+?(struct ipoint a, struct ipoint b) {
+	struct ipoint r;
+	r.x = a.x + b.x;
+	r.y = a.y + b.y;
+	return r;
+}
+
+struct ipoint ?-?(struct ipoint a, struct ipoint b) {
+	struct ipoint r;
+	r.x = a.x - b.x;
+	r.y = a.y - b.y;
+	return r;
+}
+
+struct ipoint ?*?(struct ipoint a, struct ipoint b) {
+	struct ipoint r;
+	r.x = a.x * b.x;
+	r.y = a.y * b.y;
+	return r;
+}
+
+struct dpoint {
+	double x;
+	double y;
+};
+
+struct dpoint ?+?(struct dpoint a, struct dpoint b) {
+	struct dpoint r;
+	r.x = a.x + b.x;
+	r.y = a.y + b.y;
+	return r;
+}
+
+struct dpoint ?-?(struct dpoint a, struct dpoint b) {
+	struct dpoint r;
+	r.x = a.x - b.x;
+	r.y = a.y - b.y;
+	return r;
+}
+
+struct dpoint ?*?(struct dpoint a, struct dpoint b) {
+	struct dpoint r;
+	r.x = a.x * b.x;
+	r.y = a.y * b.y;
+	return r;
+}
+
+int a2b2_mono_int(int a, int b) {
+	return (a - b)*(a + b);
+}
+
+double a2b2_mono_double(double a, double b) {
+	return (a - b)*(a + b);
+}
+
+struct ipoint a2b2_mono_ipoint(struct ipoint a, struct ipoint b) {
+	return (a - b)*(a + b);
+}
+
+struct dpoint a2b2_mono_dpoint(struct dpoint a, struct dpoint b) {
+	return (a - b)*(a + b);
+}
+
+forall(type T | { T ?+?(T,T); T ?-?(T,T); T ?*?(T,T); })
+T a2b2_poly(T a, T b) {
+	return (a - b)*(a + b);
+}
+
+typedef int clock_t;
+long ms_between(clock_t start, clock_t end) {
+//	return (end - start) / (CLOCKS_PER_SEC / 1000);
+	return 0;
+}
+int clock() { return 3; }
+
+int main(int argc, char** argv) {
+	clock_t start, end;
+	int i;
+	
+	int a, b;
+	double c, d;
+	struct ipoint p, q;
+	struct dpoint r, s;
+	
+	printf("\n## a^2-b^2 ##\n");
+	
+	a = 5, b = 3;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		a = a2b2_mono_int(a, b);
+		b = a2b2_mono_int(b, a);
+	}
+	end = clock();
+	printf("mono_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
+	
+	a = 5, b = 3;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		a = a2b2_poly(a, b);
+		b = a2b2_poly(b, a);
+	}
+	end = clock();
+	printf("poly_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
+	
+/*	{
+	a = 5, b = 3;
+	// below doesn't actually work; a2b2_poly isn't actually assigned, just declared
+	* [int] (int, int) a2b2_poly = a2b2_mono_int;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+//			printf("\t[%d,%d]\n", a, b);
+a = a2b2_poly(a, b);
+//			printf("\t[%d,%d]\n", a, b);
+b = a2b2_poly(b, a);
+}
+end = clock();
+printf("spec_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
+}
+*/	
+	c = 5.0, d = 3.0;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		c = a2b2_mono_double(c, d);
+		d = a2b2_mono_double(d, c);
+	}
+	end = clock();
+	printf("mono_double:%7ld  [%f,%f]\n", ms_between(start, end), c, d);
+		
+	c = 5.0, d = 3.0;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		c = a2b2_poly(c, d);
+		d = a2b2_poly(d, c);
+	}
+	end = clock();
+	printf("poly_double:%7ld  [%f,%f]\n", ms_between(start, end), c, d);
+	
+	p.x = 5, p.y = 5, q.x = 3, q.y = 3;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		p = a2b2_mono_ipoint(p, q);
+		q = a2b2_mono_ipoint(q, p);
+	}
+	end = clock();
+	printf("mono_ipoint:%7ld  [(%d,%d),(%d,%d)]\n", ms_between(start, end), p.x, p.y, q.x, q.y);
+		
+	p.x = 5, p.y = 5, q.x = 3, q.y = 3;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		p = a2b2_poly(p, q);
+		q = a2b2_poly(q, p);
+	}
+	end = clock();
+	printf("poly_ipoint:%7ld  [(%d,%d),(%d,%d)]\n", ms_between(start, end), p.x, p.y, q.x, q.y);
+	
+	r.x = 5.0, r.y = 5.0, s.x = 3.0, s.y = 3.0;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		r = a2b2_mono_dpoint(r, s);
+		s = a2b2_mono_dpoint(s, r);
+	}
+	end = clock();
+	printf("mono_dpoint:%7ld  [(%f,%f),(%f,%f)]\n", ms_between(start, end), r.x, r.y, s.x, s.y);
+		
+	r.x = 5.0, r.y = 5.0, s.x = 3.0, s.y = 3.0;
+	start = clock();
+	for (i = 0; i < N/2; ++i) {
+		r = a2b2_poly(r, s);
+		s = a2b2_poly(s, r);
+	}
+	end = clock();
+	printf("poly_dpoint:%7ld  [(%f,%f),(%f,%f)]\n", ms_between(start, end), r.x, r.y, s.x, s.y);
+
+	return 0;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa poly-bench.c" //
+// End: //
Index: src/tests/.expect/CastError.txt
===================================================================
--- src/tests/.expect/CastError.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/CastError.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,42 @@
+CFA Version 1.0.0 (debug)
+Error: Can't choose between alternatives for expression Cast of:
+  Name: f
+
+to:
+  char
+Alternatives are:        Cost ( 1, 0, 0 ): Cast of:
+          Variable Expression: f: function
+                accepting unspecified arguments
+              returning 
+                nothing 
+
+
+        to:
+          char
+(types:
+            char
+)
+        Environment: 
+
+        Cost ( 1, 0, 0 ): Cast of:
+          Variable Expression: f: signed int
+
+        to:
+          char
+(types:
+            char
+)
+        Environment: 
+
+        Cost ( 1, 0, 0 ): Cast of:
+          Variable Expression: f: double
+
+        to:
+          char
+(types:
+            char
+)
+        Environment: 
+
+
+make: *** [CastError] Error 1
Index: src/tests/.expect/Constant0-1DP.txt
===================================================================
--- src/tests/.expect/Constant0-1DP.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/Constant0-1DP.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,34 @@
+CFA Version 1.0.0 (debug)
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for 0: pointer to signed int
+Error: duplicate object definition for 1: pointer to signed int
+Error: duplicate object definition for 0: pointer to signed int
+Error: duplicate object definition for 1: pointer to signed int
+Error: duplicate object definition for 0: pointer to signed int
+Error: duplicate object definition for 1: pointer to signed int
+Error: duplicate object definition for 0: pointer to signed int
+Error: duplicate object definition for 1: pointer to signed int
+Error: duplicate object definition for 0: const pointer to signed int
+Error: duplicate object definition for 1: const pointer to signed int
+Error: duplicate object definition for 0: const pointer to signed int
+Error: duplicate object definition for 1: const pointer to signed int
+Error: duplicate object definition for 0: const pointer to signed int
+Error: duplicate object definition for 1: const pointer to signed int
+Error: duplicate object definition for x: const pointer to pointer to signed int
+Error: duplicate object definition for 0: pointer to pointer to signed int
+Error: duplicate object definition for x: const pointer to pointer to signed int
+Error: duplicate object definition for 0: pointer to pointer to signed int
+Error: duplicate object definition for x: const pointer to pointer to signed int
+Error: duplicate object definition for 0: pointer to pointer to signed int
+make: *** [Constant0-1DP] Error 1
Index: src/tests/.expect/Constant0-1NDDP.txt
===================================================================
--- src/tests/.expect/Constant0-1NDDP.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/Constant0-1NDDP.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,18 @@
+CFA Version 1.0.0 (debug)
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 0: signed int
+Error: duplicate object definition for 1: signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for 0: const signed int
+Error: duplicate object definition for 1: const signed int
+Error: duplicate object definition for x: pointer to signed int
+Error: duplicate object definition for 0: pointer to signed int
+Error: duplicate object definition for x: const pointer to signed int
+Error: duplicate object definition for 0: const pointer to signed int
+make: *** [Constant0-1NDDP] Error 1
Index: src/tests/.expect/DeclarationErrors.txt
===================================================================
--- src/tests/.expect/DeclarationErrors.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/DeclarationErrors.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,16 @@
+CFA Version 1.0.0 (debug)
+Error: invalid combination of storage classes in declaration of x9: static static volatile const short int 
+
+Error: invalid combination of storage classes in declaration of x18: static static const volatile instance of struct __anonymous0
+  with members 
+    i: int 
+
+
+Error: invalid combination of storage classes in declaration of x19: static static const volatile volatile instance of struct __anonymous1
+  with members 
+    i: int 
+
+
+Error: invalid combination of storage classes in declaration of x28: static static volatile const instance of type Int
+
+make: *** [DeclarationErrors] Error 1
Index: src/tests/.expect/DeclarationSpecifier.txt
===================================================================
--- src/tests/.expect/DeclarationSpecifier.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/DeclarationSpecifier.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,16 @@
+CFA Version 1.0.0 (debug)
+Error: invalid combination of storage classes in declaration of x9: static static volatile const short int 
+
+Error: invalid combination of storage classes in declaration of x18: static static const volatile instance of struct __anonymous8
+  with members 
+    i: int 
+
+
+Error: invalid combination of storage classes in declaration of x19: static static const volatile volatile instance of struct __anonymous9
+  with members 
+    i: int 
+
+
+Error: invalid combination of storage classes in declaration of x28: static static volatile const instance of type Int
+
+make: *** [DeclarationSpecifier] Error 1
Index: src/tests/.expect/ScopeErrors.txt
===================================================================
--- src/tests/.expect/ScopeErrors.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/ScopeErrors.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,11 @@
+CFA Version 1.0.0 (debug)
+Error: duplicate object definition for thisIsAnError: signed int
+Error: duplicate function definition for butThisIsAnError: function
+  with parameters
+    double
+  returning 
+    double
+  with body 
+    CompoundStmt
+
+make: *** [ScopeErrors] Error 1
Index: src/tests/.expect/abs.txt
===================================================================
--- src/tests/.expect/abs.txt	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/.expect/abs.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,4 +1,2 @@
-/usr/local/bin/cfa -g -Wall -Wno-unused-function     abs.c   -o abs
-CFA Version 1.0.0 (debug)
 char			¿	abs A
 signed int		-65	abs 65
Index: src/tests/.expect/ato.txt
===================================================================
--- src/tests/.expect/ato.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/ato.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,13 @@
+-123 -123
+123 123
+-123 -123
+123 123
+-123 -123
+123 123
+-123.456 -123.456
+-123.456789012346 -123.4567890123456
+-123.456789012345679 -123.45678901234567890123456789
+-123.456-123.456i -123.456-123.456i
+-123.456789012346+123.456789012346i -123.4567890123456+123.4567890123456i
+123.456789012345679-123.456789012345679i 123.45678901234567890123456789-123.45678901234567890123456789i
+123.45678901234-123.456789i 123.45678901234-123.4567890i
Index: src/tests/.expect/io.txt
===================================================================
--- src/tests/.expect/io.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/io.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,26 @@
+9 6 28 0 7 1 2
+1 2 3
+123
+123
+
+A 
+1 2 3 4 5 6 7 8
+1.1 1.2 1.3
+1.1+2.3i 1.1-2.3i 1.1-2.3i
+
+1.11.21.3
+1.1+2.3i1.1-2.3i1.1-2.3i
+ abcxyz
+abcxyz
+
+1.1, $1.2, $1.3
+1.1+2.3i, $1.1-2.3i, $1.1-2.3i
+abc, $xyz
+
+v(27 v[27 v{27 $27 £27 ¥27 ¡27 ¿27 «27
+25, 25. 25: 25; 25! 25? 25) 25] 25} 25% 25¢ 25»
+25'27 25`27 25"27 25 27 25
+27 25
+27 25
+27 25	27 25
+27
Index: src/tests/.expect/math.txt
===================================================================
--- src/tests/.expect/math.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/math.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,59 @@
+fabs: 1 1 1 1.41421 1.41421356237309505 1.41421356237309505
+fmod: 1 1 1 1 1 1
+remainder: -1 -1 -1
+remquo: 7 0.0999999 7 0.1 7 0.0999999999999999999
+div: 7 0.0999999 7 0.1 7 0.0999999999999999999
+fma: -2 -2 -2
+fdim: 2 2 2
+nan: nan nan nan
+exp: 2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
+exp2: 2 2 2
+expm1: 1.71828 1.71828182845905 1.71828182845904524
+log: 0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
+log2: 3 3 3
+log10: 2 2 2
+log1p: 0.693147 0.693147180559945 0.693147180559945309
+ilogb: 0 0 0
+logb: 3 3 3
+sqrt: 1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
+cbrt: 3 3 3
+hypot: 1.41421 1.4142135623731 1.41421356237309505
+pow: 1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i 0.273957253830121071+0.583700758758614628i
+sin: 0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
+cos: 0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
+tan: 1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
+asin: 1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
+acos: 0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
+atan: 0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
+atan2: 0.785398 0.785398163397448 0.78539816339744831 atan: 0.785398 0.785398163397448 0.78539816339744831 sinh: 1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
+cosh: 1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
+tanh: 0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
+acosh: 0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
+asinh: 0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
+atanh: inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
+erf: 0.842701 0.842700792949715 0.842700792949714869
+erfc: 0.157299 0.157299207050285 0.157299207050285131
+lgamma: 1.79176 1.79175946922805 1.791759469228055
+lgamma: 1.79176 1 1.79175946922805 1 1.791759469228055 1
+tgamma: 6 6 6
+floor: 1 1 1
+ceil: 2 2 2
+trunc: 3 3 3
+rint: 2 2 2
+rint: 2 2 2
+rint: 2 2 2
+lrint: 2 2 2
+llrint: 2 2 2
+nearbyint: 4 4 4
+round: 2 2 2
+round: 2 2 2
+round: 2 2 2
+lround: 2 2 2
+llround: 2 2 2
+copysign: -1 -1 -1
+frexp: 0.5 3 0.5 3 0.5 3
+ldexp: 8 8 8
+modf: 2 0.3 2 0.3 2 0.3 nextafter: 2 2 2
+nexttoward: 2 2 2
+scalbn: 16 16 16
+scalbln: 16 16 16
Index: src/tests/.expect/minmax.txt
===================================================================
--- src/tests/.expect/minmax.txt	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/.expect/minmax.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,21 @@
+char			z a	min a
+signed int		4 3	min 3
+unsigned int		4 3	min 3
+signed long int		4 3	min 3
+unsigned long int	4 3	min 3
+signed long long int	4 3	min 3
+unsigned long long int	4 3	min 3
+float			4 3.1	min 3.1
+double			4 3.1	min 3.1
+long double		4 3.1	min 3.1
+
+char			z a	max z
+signed int		4 3	max 4
+unsigned int		4 3	max 4
+signed long int		4 3	max 4
+unsigned long int	4 3	max 4
+signed long long int	4 3	max 4
+unsigned long long int	4 3	max 4
+float			4 3.1	max 4
+double			4 3.1	max 4
+long double		4 3.1	max 4
Index: src/tests/.expect/swap.txt
===================================================================
--- src/tests/.expect/swap.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
+++ src/tests/.expect/swap.txt	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -0,0 +1,14 @@
+char			a b			swap 	b a
+signed int		-1 -2			swap 	-2 -1
+unsigned int		1 2			swap 	2 1
+signed long int		-1 -2			swap 	-2 -1
+unsigned long int	1 2			swap 	2 1
+signed long long int	-1 -2			swap 	-2 -1
+unsigned long long int	1 2			swap 	2 1
+float			1.5 2.5			swap 	2.5 1.5
+double			1.5 2.5			swap 	2.5 1.5
+long double		1.5 2.5			swap 	2.5 1.5
+float _Complex		1.5+1.5i 2.5+2.5i	swap 	2.5+2.5i 1.5+1.5i
+double _Complex		1.5+1.5i 2.5+2.5i	swap 	2.5+2.5i 1.5+1.5i
+long double _Complex	1.5+1.5i 2.5+2.5i	swap 	2.5+2.5i 1.5+1.5i
+struct S		1 2, 2 1		swap 	2 1, 1 2
Index: src/tests/Cast.c
===================================================================
--- src/tests/Cast.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Cast.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -9,5 +9,5 @@
 	(int)f;
 	(void(*)())f;
-	([long, long double, *[]()])([f, f, f]);
+//	([long, long double, *[]()])([f, f, f]);
 }
 
Index: src/tests/CommentMisc.c
===================================================================
--- src/tests/CommentMisc.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/CommentMisc.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,40 +1,2 @@
-/* single line */
-// single line
-
-// single line containing */
-// single line containing /*
-// single line containing /* */
-
-/* 1st */ int i;
-int i; /* 2nd */
-/* 1st */ int i; /* 2nd */
-/* 1st */ /* 2nd */
-
-/* 1st
-   2nd */ int i;
-
-/*
-*/
-
-/*
-
-*/
-
-/*
-  1st
-*/
-
-/*
-  1st
-  2nd
-*/
-
-// ignore preprocessor directives
-
-#line 2
- #
- #include <fred>
-	#define mary abc
-
 // alternative ANSI99 brackets
 
Index: src/tests/Constant0-1.c
===================================================================
--- src/tests/Constant0-1.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Constant0-1.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,4 +1,3 @@
-//Constant test declaration
-// Cforall extension
+// Constant test declaration
 
 // value
@@ -6,18 +5,35 @@
 int 0;
 const int 0;
-static const int 0;
 int 1;
 const int 1;
-static const int 1;
-int 0, 1;
-const int 0, 1;
+struct { int i; } 0;
+const struct { int i; } 1;
+
+#ifdef DUPS
+
+int 0;
+const int 0;
+int 1;
+const int 1;
 int (0), (1);
 int ((0)), ((1));
-static const int 0, 1;
+const int 0, 1;
+const int (0), (1);
 struct { int i; } 0;
 const struct { int i; } 1;
-static const struct { int i; } 1;
+
+#endif // DUPS
+
+#ifndef NEWDECL
 
 // pointer
+
+int *0, *1;
+int * const (0), * const 1;
+struct { int i; } *0;
+const struct { int i; } *0;
+int (*(* const x)), **0;
+
+#ifdef DUPS
 
 int *0, *1;
@@ -28,5 +44,13 @@
 int (* const 0), (* const 1);
 int ((* const 0)), ((* const 1));
+int (*(* const x)), *(*0);
+int (*(* const x)), (*(*0));
 struct { int i; } *0;
+const struct { int i; } *0;
+int (*(* const x)), **0;
+
+#endif // DUPS
+
+#else
 
 // Cforall style
@@ -34,14 +58,22 @@
 * int x, 0;
 const * int x, 0;
-static const * int x, 0;
 * struct { int i; } 0;
 const * struct { int i; } 0;
-static const * struct { int i; } 0;
-static * int x, 0;
-static const * int x, 0;
 const * * int x, 0;
 
+#ifdef DUPS
+
+* int x, 0;
+const * int x, 0;
+
+#endif // DUPS
+
+#endif // NEWDECL
+
 int main() {
+#ifndef NEWDECL
     int 1, * 0;
+#else
     * int x, 0;
+#endif // NEWDECL
 }
Index: src/tests/Context.c
===================================================================
--- src/tests/Context.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Context.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,9 +1,10 @@
-//cforall context declaration
-context has_q( otype T ) {
+// trait declaration
+
+trait has_q( otype T ) {
 	T q( T );
 };
 
 forall( otype z | has_q( z ) ) void f() {
-	context has_r( otype T, otype U ) {
+	trait has_r( otype T, otype U ) {
 		T r( T, T (T,U) );
 	};
Index: src/tests/Exception.c
===================================================================
--- src/tests/Exception.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Exception.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -10,5 +10,5 @@
     try {
 	x/4;
-    } catch( int) {
+    } catch( int ) {
     } catch( int x ) {
     } catch( struct { int i; } ) {
Index: src/tests/Expression.c
===================================================================
--- src/tests/Expression.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Expression.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,11 +1,6 @@
-int fred() {
-    struct s { int i; } *p;
-    int i;
+int main() {
+    struct s { int i; } x, *p = &x;
+    int i = 3;
 
-    // order of evaluation (GCC is different)
-/*
-    i = sizeof( (int) {3} );
-    i = sizeof (int) {3};
-*/
     // operators
 
@@ -42,9 +37,9 @@
     i||i;
     p->i;
-    i+=i;
-    i-=i;
     i*=i;
     i/=i;
     i%=i;
+    i+=i;
+    i-=i;
     i&=i;
     i|=i;
@@ -54,20 +49,3 @@
 
     i?i:i;
-
-    // cast
-/*
-    double d;
-    int *ip;
-    (int *) i;
-    (* int) i;
-    ([char, int *])[d, d];
-    [i,ip,ip] = ([int, * int, int *])[1,(void *)2,(void *)3];
-    [i,ip,ip] = ([int, * int, int *])([1,(void *)2,(void *)3]);
-*/
-}
-
-//Dummy main
-int main(int argc, char const *argv[])
-{
-	return 0;
-}
+} // main
Index: src/tests/Forall.c
===================================================================
--- src/tests/Forall.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Forall.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -10,10 +10,10 @@
 	void f( int );
 	void h( void (*p)(void) );
-  
+
 	int x;
 	void (*y)(void);
 	char z;
 	float w;
-  
+
 	f( x );
 	f( y );
@@ -26,10 +26,10 @@
 	forall( otype T ) void f( T, T );
 	forall( otype T, otype U ) void f( T, U );
-  
+
 	int x;
 	float y;
 	int *z;
 	float *w;
-  
+
 	f( x, y );
 	f( z, w );
@@ -46,5 +46,5 @@
 }
 
-context sumable( otype T ) {
+trait sumable( otype T ) {
 	const T 0;
 	T ?+?(T, T);
Index: src/tests/Makefile.am
===================================================================
--- src/tests/Makefile.am	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Makefile.am	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 09:08:15 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Mon Jan 25 22:31:42 2016
-## Update Count     : 25
+## Last Modified On : Mon Jun 20 14:30:52 2016
+## Update Count     : 33
 ###############################################################################
 
@@ -23,2 +23,11 @@
 vector_test_SOURCES = vector/vector_int.c vector/array.c vector/vector_test.c
 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
+
+Constant0-1DP : Constant0-1.c
+	${CC} ${CFLAGS} -DDUPS ${<} -o ${@}
+
+Constant0-1ND : Constant0-1.c
+	${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}
+
+Constant0-1NDDP : Constant0-1.c
+	${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@}
Index: src/tests/Makefile.in
===================================================================
--- src/tests/Makefile.in	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Makefile.in	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -621,4 +621,13 @@
 
 
+Constant0-1DP : Constant0-1.c
+	${CC} ${CFLAGS} -DDUPS ${<} -o ${@}
+
+Constant0-1ND : Constant0-1.c
+	${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@}
+
+Constant0-1NDDP : Constant0-1.c
+	${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@}
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
Index: src/tests/Operators.c
===================================================================
--- src/tests/Operators.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Operators.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,3 +1,5 @@
-int ?*?( int, int );
+int ?*?( int a, int b ) {
+	return 0;
+}
 
 int ?()( int number1, int number2 ) {
@@ -5,12 +7,18 @@
 }
 
-int ?+?( int, int );
+int ?+?( int a, int b ) {
+	return 0;
+}
 
-int ?=?( int *, int );
+int ?=?( int *a, int b ) {
+	return 0;
+}
 struct accumulator {
 	int total;
 };
 
-char ?()( struct accumulator a, char number1, char number2 );
+char ?()( struct accumulator a, char number1, char number2 ) {
+	return 'a';
+}
 
 void f( void ) {
@@ -23,4 +31,9 @@
 }
 
+int main(int argc, char const *argv[]) {
+	/* code */
+	return 0;
+}
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/tests/Scope.c
===================================================================
--- src/tests/Scope.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Scope.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -15,5 +15,5 @@
 y p;
 
-context has_u( otype z ) {
+trait has_u( otype z ) {
 	z u(z);
 };
Index: src/tests/Subrange.c
===================================================================
--- src/tests/Subrange.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Subrange.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,5 +1,5 @@
 // A small context defining the notion of an ordered otype.  (The standard
 // library should probably contain a context for this purpose.)
-context ordered(otype T) {
+trait ordered(otype T) {
     int ?<?(T, T), ?<=?(T, T);
 };
Index: src/tests/Switch.c
===================================================================
--- src/tests/Switch.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Switch.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,3 +1,3 @@
-int fred() {
+int main(int argc, char const *argv[]) {
     int i;
     switch ( i ) case 3 : i = 1;
Index: src/tests/Typedef.c
===================================================================
--- src/tests/Typedef.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Typedef.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -18,5 +18,5 @@
 a c;
 
-typedef otypeof(3) x, y;  // GCC
+typedef typeof(3) x, y;  // GCC
 
 x p;
@@ -24,5 +24,5 @@
 
 int main() {
-    typedef otypeof(3) z, p;
+    typedef typeof(3) z, p;
     z w;
     p x;
Index: src/tests/Typeof.c
===================================================================
--- src/tests/Typeof.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/Typeof.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -1,10 +1,10 @@
 int main() {
     int *v1;
-    otypeof(v1) v2;
-    otypeof(*v1) v3[4];
+    typeof(v1) v2;
+    typeof(*v1) v3[4];
     char *v4[4];
-    otypeof(otypeof(char *)[4]) v5;
-    otypeof (int *) v6;
-    otypeof( int ( int, int p ) ) *v7;
-    otypeof( [int] ( int, int p ) ) *v8;
+    typeof(typeof(char *)[4]) v5;
+    typeof (int *) v6;
+    typeof( int ( int, int p ) ) *v7;
+    typeof( [int] ( int, int p ) ) *v8;
 }
Index: src/tests/limits.c
===================================================================
--- src/tests/limits.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/limits.c	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// limits.c -- 
+// limits.c --
 //
 // Author           : Peter A. Buhr
@@ -12,5 +12,5 @@
 // Last Modified On : Tue May 10 20:45:28 2016
 // Update Count     : 1
-// 
+//
 
 #include <limits>
@@ -109,4 +109,9 @@
 long _Complex _1_sqrt_2 = _1_SQRT_2;
 
+int main(int argc, char const *argv[]) {
+	//DUMMY
+	return 0;
+}
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/tests/poly-bench.c
===================================================================
--- src/tests/poly-bench.c	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ 	(revision )
@@ -1,207 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// poly-bench.cc -- 
-//
-// Author           : Aaron Moss
-// Created On       : Sat May 16 07:26:30 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 18:25:19 2015
-// Update Count     : 5
-//
-
-extern "C" {
-#include <stdio.h>
-//#include "my_time.h"
-}
-
-#define N 200000000
-
-struct ipoint {
-	int x;
-	int y;
-};
-
-struct ipoint ?+?(struct ipoint a, struct ipoint b) {
-	struct ipoint r;
-	r.x = a.x + b.x;
-	r.y = a.y + b.y;
-	return r;
-}
-
-struct ipoint ?-?(struct ipoint a, struct ipoint b) {
-	struct ipoint r;
-	r.x = a.x - b.x;
-	r.y = a.y - b.y;
-	return r;
-}
-
-struct ipoint ?*?(struct ipoint a, struct ipoint b) {
-	struct ipoint r;
-	r.x = a.x * b.x;
-	r.y = a.y * b.y;
-	return r;
-}
-
-struct dpoint {
-	double x;
-	double y;
-};
-
-struct dpoint ?+?(struct dpoint a, struct dpoint b) {
-	struct dpoint r;
-	r.x = a.x + b.x;
-	r.y = a.y + b.y;
-	return r;
-}
-
-struct dpoint ?-?(struct dpoint a, struct dpoint b) {
-	struct dpoint r;
-	r.x = a.x - b.x;
-	r.y = a.y - b.y;
-	return r;
-}
-
-struct dpoint ?*?(struct dpoint a, struct dpoint b) {
-	struct dpoint r;
-	r.x = a.x * b.x;
-	r.y = a.y * b.y;
-	return r;
-}
-
-int a2b2_mono_int(int a, int b) {
-	return (a - b)*(a + b);
-}
-
-double a2b2_mono_double(double a, double b) {
-	return (a - b)*(a + b);
-}
-
-struct ipoint a2b2_mono_ipoint(struct ipoint a, struct ipoint b) {
-	return (a - b)*(a + b);
-}
-
-struct dpoint a2b2_mono_dpoint(struct dpoint a, struct dpoint b) {
-	return (a - b)*(a + b);
-}
-
-forall(type T | { T ?+?(T,T); T ?-?(T,T); T ?*?(T,T); })
-T a2b2_poly(T a, T b) {
-	return (a - b)*(a + b);
-}
-
-typedef int clock_t;
-long ms_between(clock_t start, clock_t end) {
-//	return (end - start) / (CLOCKS_PER_SEC / 1000);
-	return 0;
-}
-int clock() { return 3; }
-
-int main(int argc, char** argv) {
-	clock_t start, end;
-	int i;
-	
-	int a, b;
-	double c, d;
-	struct ipoint p, q;
-	struct dpoint r, s;
-	
-	printf("\n## a^2-b^2 ##\n");
-	
-	a = 5, b = 3;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		a = a2b2_mono_int(a, b);
-		b = a2b2_mono_int(b, a);
-	}
-	end = clock();
-	printf("mono_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
-	
-	a = 5, b = 3;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		a = a2b2_poly(a, b);
-		b = a2b2_poly(b, a);
-	}
-	end = clock();
-	printf("poly_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
-	
-/*	{
-	a = 5, b = 3;
-	// below doesn't actually work; a2b2_poly isn't actually assigned, just declared
-	* [int] (int, int) a2b2_poly = a2b2_mono_int;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-//			printf("\t[%d,%d]\n", a, b);
-a = a2b2_poly(a, b);
-//			printf("\t[%d,%d]\n", a, b);
-b = a2b2_poly(b, a);
-}
-end = clock();
-printf("spec_int:   %7ld  [%d,%d]\n", ms_between(start, end), a, b);
-}
-*/	
-	c = 5.0, d = 3.0;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		c = a2b2_mono_double(c, d);
-		d = a2b2_mono_double(d, c);
-	}
-	end = clock();
-	printf("mono_double:%7ld  [%f,%f]\n", ms_between(start, end), c, d);
-		
-	c = 5.0, d = 3.0;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		c = a2b2_poly(c, d);
-		d = a2b2_poly(d, c);
-	}
-	end = clock();
-	printf("poly_double:%7ld  [%f,%f]\n", ms_between(start, end), c, d);
-	
-	p.x = 5, p.y = 5, q.x = 3, q.y = 3;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		p = a2b2_mono_ipoint(p, q);
-		q = a2b2_mono_ipoint(q, p);
-	}
-	end = clock();
-	printf("mono_ipoint:%7ld  [(%d,%d),(%d,%d)]\n", ms_between(start, end), p.x, p.y, q.x, q.y);
-		
-	p.x = 5, p.y = 5, q.x = 3, q.y = 3;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		p = a2b2_poly(p, q);
-		q = a2b2_poly(q, p);
-	}
-	end = clock();
-	printf("poly_ipoint:%7ld  [(%d,%d),(%d,%d)]\n", ms_between(start, end), p.x, p.y, q.x, q.y);
-	
-	r.x = 5.0, r.y = 5.0, s.x = 3.0, s.y = 3.0;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		r = a2b2_mono_dpoint(r, s);
-		s = a2b2_mono_dpoint(s, r);
-	}
-	end = clock();
-	printf("mono_dpoint:%7ld  [(%f,%f),(%f,%f)]\n", ms_between(start, end), r.x, r.y, s.x, s.y);
-		
-	r.x = 5.0, r.y = 5.0, s.x = 3.0, s.y = 3.0;
-	start = clock();
-	for (i = 0; i < N/2; ++i) {
-		r = a2b2_poly(r, s);
-		s = a2b2_poly(s, r);
-	}
-	end = clock();
-	printf("poly_dpoint:%7ld  [(%f,%f),(%f,%f)]\n", ms_between(start, end), r.x, r.y, s.x, s.y);
-
-	return 0;
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa poly-bench.c" //
-// End: //
Index: src/tests/runTests.sh
===================================================================
--- src/tests/runTests.sh	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/runTests.sh	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -69,4 +69,4 @@
 python test.py ${tests}
 
-ret_val=0
+ret_val=$?
 exit $((ret_val))
Index: src/tests/test.py
===================================================================
--- src/tests/test.py	(revision f6d4204edf37a707e64578aa3b82d8d12680555f)
+++ src/tests/test.py	(revision b2b039d9772b7f152f58bfc5777b2f070864bed5)
@@ -3,5 +3,5 @@
 
 from os import listdir
-from os.path import isfile, join
+from os.path import isfile, join, splitext
 from subprocess import Popen, PIPE, STDOUT
 
@@ -13,8 +13,7 @@
 ################################################################################
 def listTests():
-	list = [f.rstrip('.c') for f in listdir('.')
-		if not f.startswith('.') and (
-			not isfile(f) or f.endswith('.c')
-		)]
+	list = [splitext(f)[0] for f in listdir('./.expect')
+		if not f.startswith('.') and f.endswith('.txt')
+		]
 
 	return list
@@ -40,5 +39,5 @@
 
 	# build, skipping to next test on error
-	make_ret = sh("make -j 8 %s > %s 2>&1" % (test, out_file), dry_run)
+	make_ret = sh("make -j 8 %s 2> %s 1> /dev/null" % (test, out_file), dry_run)
 
 	if make_ret == 0 :
@@ -51,7 +50,4 @@
 	retcode = 0
 	if not generate :
-		# touch expected files so empty output are supported by default
-		sh("touch .expect/%s.txt" % test, dry_run)
-
 		# diff the output of the files
 		retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run)
@@ -67,11 +63,9 @@
 
 	if generate :
-		print( "Regenerate tests for: ", end="" )
-		print( ", ".join( tests ) )
+		print( "Regenerate tests for: " )
 
 	failed = False;
 	for t in tests:
-		if not generate :
-			print("%20s  " % t, end="")
+		print("%20s  " % t, end="")
 		sys.stdout.flush()
 		test_failed = run_test_instance(t, generate, dry_run)
@@ -80,11 +74,10 @@
 		if not generate :
 			print("FAILED" if test_failed else "PASSED")
+		else :
+			print( "Done" )
 
 	sh('make clean > /dev/null 2>&1', dry_run)
 
-	if generate :
-		print( "Done" )
-
-	return 0 if failed else 1
+	return 1 if failed else 0
 
 ################################################################################
@@ -93,16 +86,37 @@
 parser = argparse.ArgumentParser(description='Script which runs cforall tests')
 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
+parser.add_argument('--list', help='List all test available', action='store_true')
 parser.add_argument('--all', help='Run all test available', action='store_true')
-parser.add_argument('--generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
+parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
 
 options = parser.parse_args()
 
-if len(options.tests) > 0 and options.all :
+if (len(options.tests) > 0  and     options.all and not options.list) \
+or (len(options.tests) == 0 and not options.all and not options.list) :
 	print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr)
 	parser.print_help()
 	sys.exit(1)
 
-tests = listTests() if options.all else options.tests
+allTests = listTests()
 
-sys.exit( run_tests(tests, options.generate_expected, options.dry_run) )
+if options.all or options.list :
+	tests = allTests
+
+else :
+	tests = []
+	for test in options.tests:
+		if test in allTests :
+			tests.append(test)
+		else :
+			print('ERROR: No expected file for test %s, ignoring it' % test, file=sys.stderr)
+
+	if len(tests) == 0 :
+		print('ERROR: No valid test to run', file=sys.stderr)
+		sys.exit(1)
+
+if options.list :
+	print("\n".join(tests))
+
+else :
+	sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run) )
