Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 45444c3fd70b6b54538ca16b790d78e084e0822e)
+++ tests/Makefile.am	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
@@ -53,5 +53,5 @@
 
 # adjust CC to current flags
-CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
 CFACC = $(CC)
 
@@ -60,5 +60,5 @@
 
 # adjusted CC but without the actual distcc call
-CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})
+CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})
 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'))
 
Index: tests/config.py.in
===================================================================
--- tests/config.py.in	(revision 45444c3fd70b6b54538ca16b790d78e084e0822e)
+++ tests/config.py.in	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
@@ -9,2 +9,3 @@
 HOSTARCH = "@host_cpu@"
 DISTRIBUTE = @HAS_DISTCC@
+NEWAST = @DEFAULT_NEW_AST@
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 45444c3fd70b6b54538ca16b790d78e084e0822e)
+++ tests/pybin/settings.py	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
@@ -98,4 +98,18 @@
 		self.path   = "debug" if value else "nodebug"
 
+class AST:
+	def __init__(self, ast):
+		if ast == "new":
+			self.string = "New AST"
+			self.flags  = """AST_FLAGS=-XCFA,--new-ast"""
+		elif ast == "old":
+			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.flags  = """AST_FLAGS="""
+		else:
+			print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
+
 class Install:
 	def __init__(self, value):
@@ -120,14 +134,17 @@
 
 def init( options ):
+	global all_ast
 	global all_arch
 	global all_debug
 	global all_install
+	global ast
 	global arch
+	global debug
 	global archive
+	global install
+
 	global continue_
-	global debug
 	global dry_run
 	global generating
-	global install
 	global make
 	global output_width
@@ -135,4 +152,5 @@
 	global timeout2gdb
 
+	all_ast      = [AST(o)          for o in list(dict.fromkeys(options.ast    ))] if options.ast  else [AST(None)]
 	all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))] if options.arch else [Architecture(None)]
 	all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
Index: tests/pybin/tools.py
===================================================================
--- tests/pybin/tools.py	(revision 45444c3fd70b6b54538ca16b790d78e084e0822e)
+++ tests/pybin/tools.py	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
@@ -181,4 +181,5 @@
 		'-s' if silent else None,
 		test_param,
+		settings.ast.flags,
 		settings.arch.flags,
 		settings.debug.flags,
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 45444c3fd70b6b54538ca16b790d78e084e0822e)
+++ tests/test.py	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
@@ -112,7 +112,8 @@
 	# create a parser with the arguments for the tests script
 	parser = argparse.ArgumentParser(description='Script which runs cforall tests')
+	parser.add_argument('--ast', help='Test for specific ast', type=comma_separated(str), default=None)
+	parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None)
 	parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes')
 	parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
-	parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None)
 	parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
 	parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=120)
@@ -362,5 +363,6 @@
 		# for each build configurations, run the test
 		with Timed() as total_dur:
-			for arch, debug, install in itertools.product(settings.all_arch, settings.all_debug, settings.all_install):
+			for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install):
+				settings.ast     = ast
 				settings.arch    = arch
 				settings.debug   = debug
@@ -377,10 +379,11 @@
 
 				# print configuration
-				print('%s %i tests on %i cores (%s:%s)' % (
+				print('%s %i tests on %i cores (%s:%s - %s)' % (
 					'Regenerating' if settings.generating else 'Running',
 					len(local_tests),
 					options.jobs,
 					settings.arch.string,
-					settings.debug.string
+					settings.debug.string,
+					settings.ast.string
 				))
 
