Index: tests/.expect/castError.oast.txt
===================================================================
--- tests/.expect/castError.oast.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/.expect/castError.oast.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,70 @@
+castError.cfa:23:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: f
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: f: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: f: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: f: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
+castError.cfa:28:1 error: Cannot choose between 2 alternatives for expression
+Generated Cast of:
+  Comma Expression:
+    constant expression (3 3: signed int)
+    Name: v
+... to: nothing Alternatives are:
+Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
+      Comma Expression:
+        constant expression (3 3: signed int)
+        Variable Expression: v: unsigned char
+    ... to: nothing
+  (types:
+    void 
+  )
+  Environment:
+
+Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
+      Comma Expression:
+        constant expression (3 3: signed int)
+        Variable Expression: v: signed short int
+    ... to: nothing
+  (types:
+    void 
+  )
+  Environment:
+
+
+castError.cfa:30:1 error: No reasonable alternatives for expression Explicit Cast of:
+  Name: sint
+... to:
+  instance of struct S with body 1
+  ... with parameters
+    char
+
Index: sts/.expect/castError.txt
===================================================================
--- tests/.expect/castError.txt	(revision daefe93df0da625f84188e00b080a708ff2281f2)
+++ 	(revision )
@@ -1,70 +1,0 @@
-castError.cfa:23:1 error: Cannot choose between 3 alternatives for expression
-Explicit Cast of:
-  Name: f
-... to:
-  char Alternatives are:
-Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
-      Variable Expression: f: function
-        accepting unspecified arguments
-      ... returning nothing
-
-    ... to:
-      char
-  (types:
-    char
-  )
-  Environment:
-
-Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
-      Variable Expression: f: double
-    ... to:
-      char
-  (types:
-    char
-  )
-  Environment:
-
-Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
-      Variable Expression: f: signed int
-    ... to:
-      char
-  (types:
-    char
-  )
-  Environment:
-
-
-castError.cfa:28:1 error: Cannot choose between 2 alternatives for expression
-Generated Cast of:
-  Comma Expression:
-    constant expression (3 3: signed int)
-    Name: v
-... to: nothing Alternatives are:
-Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
-      Comma Expression:
-        constant expression (3 3: signed int)
-        Variable Expression: v: unsigned char
-    ... to: nothing
-  (types:
-    void 
-  )
-  Environment:
-
-Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
-      Comma Expression:
-        constant expression (3 3: signed int)
-        Variable Expression: v: signed short int
-    ... to: nothing
-  (types:
-    void 
-  )
-  Environment:
-
-
-castError.cfa:30:1 error: No reasonable alternatives for expression Explicit Cast of:
-  Name: sint
-... to:
-  instance of struct S with body 1
-  ... with parameters
-    char
-
Index: tests/meta/.expect/archVast.nast.arm64.txt
===================================================================
--- tests/meta/.expect/archVast.nast.arm64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.nast.arm64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FA64
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/.expect/archVast.nast.x64.txt
===================================================================
--- tests/meta/.expect/archVast.nast.x64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.nast.x64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FX64
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/.expect/archVast.nast.x86.txt
===================================================================
--- tests/meta/.expect/archVast.nast.x86.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.nast.x86.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FX86
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/.expect/archVast.oast.arm64.txt
===================================================================
--- tests/meta/.expect/archVast.oast.arm64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.oast.arm64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FA64
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FA64: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/.expect/archVast.oast.x64.txt
===================================================================
--- tests/meta/.expect/archVast.oast.x64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.oast.x64.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FX64
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX64: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/.expect/archVast.oast.x86.txt
===================================================================
--- tests/meta/.expect/archVast.oast.x86.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/.expect/archVast.oast.x86.txt	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,36 @@
+meta/archVast.cfa:28:1 error: Cannot choose between 3 alternatives for expression
+Explicit Cast of:
+  Name: FX86
+... to:
+  char Alternatives are:
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: function
+        accepting unspecified arguments
+      ... returning nothing
+
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: double
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
+      Variable Expression: FX86: signed int
+    ... to:
+      char
+  (types:
+    char
+  )
+  Environment:
+
+
Index: tests/meta/archVast.cfa
===================================================================
--- tests/meta/archVast.cfa	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
+++ tests/meta/archVast.cfa	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -0,0 +1,32 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// archVast.cfa -- Check if all combinations are of ast/arch are properly distinguished
+//
+// Author           : Thierry Delisle
+// Created On       : Tue Nov 03 15:04:53 2020
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#if defined( __i386 )
+#define NAME FX86
+#elif defined( __x86_64 )
+#define NAME FX64
+#elif defined( __aarch64__ )
+#define NAME FA64
+#endif
+
+int NAME;
+void NAME() {
+	int NAME;
+	double NAME;
+	(char)NAME;
+	(int(*)())NAME;
+}
+
+int main() {}
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision daefe93df0da625f84188e00b080a708ff2281f2)
+++ tests/pybin/settings.py	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -85,5 +85,4 @@
 	def filter(self, tests):
 		return [test for test in tests if not test.arch or self.target == test.arch]
-		return True if not arch else self.target == arch
 
 	@staticmethod
@@ -101,14 +100,22 @@
 	def __init__(self, ast):
 		if ast == "new":
+			self.target = ast
 			self.string = "New AST"
 			self.flags  = """AST_FLAGS=-XCFA,--new-ast"""
 		elif ast == "old":
+			self.target = ast
 			self.string = "Old AST"
 			self.flags  = """AST_FLAGS=-XCFA,--old-ast"""
 		elif ast == None:
-			self.string = "Default AST (%s)" % ("new" if config.NEWAST else "old")
+			self.target = "new" if config.NEWAST else "old"
+			self.string = "Default AST (%s)" % self.target
 			self.flags  = """AST_FLAGS="""
 		else:
 			print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
+			sys.exit(1)
+
+	def filter(self, tests):
+
+		return [test for test in tests if not test.astv or self.target == test.astv]
 
 class Install:
Index: tests/pybin/test_run.py
===================================================================
--- tests/pybin/test_run.py	(revision daefe93df0da625f84188e00b080a708ff2281f2)
+++ tests/pybin/test_run.py	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -11,7 +11,8 @@
 		self.path = ''
 		self.arch = ''
+		self.astv = ''
 
 	def toString(self):
-		return "{:25s} ({:5s} {:s})".format( self.name, self.arch if self.arch else "Any", self.target() )
+		return "{:25s} ({:5s} arch, {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astv else "Any", self.target() )
 
 	def prepare(self):
@@ -20,5 +21,7 @@
 
 	def expect(self):
-		return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s.txt" % (self.name,'' if not self.arch else ".%s" % self.arch)) )
+		arch = '' if not self.arch else ".%s" % self.arch
+		astv = '' if not self.astv else ".nast" if self.astv == "new" else ".oast"
+		return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s%s.txt" % (self.name,astv,arch)) )
 
 	def error_log(self):
@@ -45,9 +48,10 @@
 
 	@staticmethod
-	def new_target(target, arch):
+	def new_target(target, arch, astv):
 		test = Test()
 		test.name = os.path.basename(target)
 		test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
 		test.arch = arch.target if arch else ''
+		test.astv = astv.target if astv else ''
 		return test
 
Index: tests/test.py
===================================================================
--- tests/test.py	(revision daefe93df0da625f84188e00b080a708ff2281f2)
+++ tests/test.py	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -24,10 +24,20 @@
 
 	def match_test(path):
-		match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
+		match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.nast|\.oast)?(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
 		if match :
 			test = Test()
 			test.name = match.group(2)
 			test.path = match.group(1)
-			test.arch = match.group(3)[1:] if match.group(3) else None
+			test.arch = match.group(4)[1:] if match.group(4) else None
+
+			astv = match.group(3)[1:] if match.group(3) else None
+			if astv == 'oast':
+				test.astv = 'old'
+			elif astv == 'nast':
+				test.astv = 'new'
+			elif astv:
+				print('ERROR: "%s", expect file has astv but it is not "nast" or "oast"' % testname, file=sys.stderr)
+				sys.exit(1)
+
 			expected.append(test)
 
@@ -66,30 +76,34 @@
 	if options.regenerate_expected :
 		for testname in options.tests :
-			testname = canonical_path( testname )
+			testname = os.path.normpath( os.path.join(settings.SRCDIR, testname) )
+
 			# first check if this is a valid name to regenerate
 			if Test.valid_name(testname):
 				# this is a valid name, let's check if it already exists
 				found = [test for test in all_tests if canonical_path( test.target() ) == testname]
+				setup = itertools.product(settings.all_arch if options.arch else [None], settings.all_ast if options.ast else [None])
 				if not found:
-					# it's a new name, create it according to the name and specified architecture
-					if options.arch:
-						# user specified one or multiple architectures, assume the tests will have architecture specific results
-						tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] )
-					else:
-						# user didn't specify an architecture, just create a cross platform test
-						tests.append( Test.new_target( testname, None ) )
+					# it's a new name, create it according to the name and specified architecture/ast version
+					tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
 				elif len(found) == 1 and not found[0].arch:
 					# we found a single test, the user better be wanting to create a cross platform test
 					if options.arch:
 						print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr)
+					elif options.ast:
+						print('ERROR: "%s", test has no specified ast version but --ast was specified, ignoring it' % testname, file=sys.stderr)
 					else:
 						tests.append( found[0] )
 				else:
 					# this test is already cross platform, just add a test for each platform the user asked
-					tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] )
+					tests.extend( [Test.new_target(testname, arch, ast) for arch, ast in setup] )
 
 					# print a warning if it users didn't ask for a specific architecture
 					if not options.arch:
 						print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr)
+
+
+					# print a warning if it users didn't ask for a specific ast version
+					if not options.ast:
+						print('WARNING: "%s", test has ast version specific expected files but --ast was not specified, regenerating only for current ast' % testname, file=sys.stderr)
 
 			else :
@@ -252,8 +266,8 @@
 	except KeyboardInterrupt:
 		return False, ""
-	except Exception as ex:
-		print("Unexpected error in worker thread running {}: {}".format(t.target(), ex), file=sys.stderr)
-		sys.stderr.flush()
-		return False, ""
+	# except Exception as ex:
+	# 	print("Unexpected error in worker thread running {}: {}".format(t.target(), ex), file=sys.stderr)
+	# 	sys.stderr.flush()
+	# 	return False, ""
 
 
@@ -371,5 +385,6 @@
 				# filter out the tests for a different architecture
 				# tests are the same across debug/install
-				local_tests = settings.arch.filter( tests )
+				local_tests = settings.ast.filter( tests )
+				local_tests = settings.arch.filter( local_tests )
 				options.jobs, forceJobs = job_count( options, local_tests )
 				settings.update_make_cmd(forceJobs, options.jobs)
@@ -383,8 +398,11 @@
 					len(local_tests),
 					options.jobs,
+					settings.ast.string,
 					settings.arch.string,
-					settings.debug.string,
-					settings.ast.string
+					settings.debug.string
 				))
+				if not local_tests :
+					print('WARNING: No tests for this configuration')
+					continue
 
 				# otherwise run all tests and make sure to return the correct error code
