MCFLAGS-allow_stubs =		--allow-stubs --no-warn-stubs --infer-all
MCFLAGS-any_call_hoist_bug = 	--loop-invariants
MCFLAGS-bad_direct_reuse =	--ctgc
MCFLAGS-bad_indirect_reuse =	--ctgc --no-common-struct
MCFLAGS-bad_indirect_reuse2 =	--ctgc --no-common-struct
MCFLAGS-bad_indirect_reuse2b =	--ctgc --no-common-struct
MCFLAGS-bad_indirect_reuse3 =	--ctgc --no-common-struct
MCFLAGS-big_array_from_list =   --optimize-tailcalls
MCFLAGS-bigtest =		--intermodule-optimization -O3
MCFLAGS-boyer =			--infer-all
MCFLAGS-bug103 =		--optimize-constructor-last-call
MCFLAGS-bug160 =		-w --optimize-peep-mkword
MCFLAGS-checked_nondet_tailcall	= --checked-nondet-tailcalls
MCFLAGS-checked_nondet_tailcall_noinline = --checked-nondet-tailcalls --no-inlining
MCFLAGS-cc_and_non_cc_test = 	--no-inlining
MCFLAGS-constraint	=	--constraint-propagation --enable-termination
MCFLAGS-constraint_order =	--constraint-propagation --enable-termination
MCFLAGS-deforest_cc_bug =	--deforestation
MCFLAGS-delay_partial_test =    --delay-partial-instantiations
MCFLAGS-delay_partial_test2 =   --delay-partial-instantiations
MCFLAGS-direct_arg_cyclic1 =	--intermodule-optimization
MCFLAGS-direct_arg_cyclic2 =	--intermodule-optimization
MCFLAGS-direct_arg_cyclic3 =	--intermodule-optimization
MCFLAGS-direct_arg_intermod1 =  --intermodule-optimization
MCFLAGS-direct_arg_intermod2 =  --intermodule-optimization
MCFLAGS-direct_arg_intermod3 =  --intermodule-optimization

# --intermodule-optimization causes impl_def_literal to abort during
# the STM transformation (bug #136).  Its use here is disabled until
# that is fixed.
MCFLAGS-impl_def_literal = --no-intermodule-optimization
MCFLAGS-impl_def_literal.sub = --no-intermodule-optimization

MCFLAGS-lp		=	--intermodule-optimization -O3
MCFLAGS-elim_local_var_char =   --eliminate-local-vars
MCFLAGS-float_consistency =	--optimize-constant-propagation
MCFLAGS-foreign_enum_mod1 = 	--intermodule-optimization
MCFLAGS-foreign_enum_mod2 = 	--intermodule-optimization
MCFLAGS-from_ground_term_bug = 	--from-ground-term-threshold=4
MCFLAGS-func_test	=	--infer-all
MCFLAGS-ho_order	=	--optimize-higher-order
MCFLAGS-ho_order2	=	--optimize-higher-order
MCFLAGS-no_fully_strict	=	--no-fully-strict
MCFLAGS-one_member	=	-O5
MCFLAGS-impure_foreign	=	--optimize-duplicate-calls
MCFLAGS-intermod_c_code =	--intermodule-optimization
MCFLAGS-intermod_c_code2 =	--intermodule-optimization
MCFLAGS-intermod_foreign_type = --intermodule-optimization
MCFLAGS-intermod_foreign_type2 = --intermodule-optimization
MCFLAGS-intermod_poly_mode = 	--intermodule-optimization
MCFLAGS-intermod_poly_mode_2 = 	--intermodule-optimization
MCFLAGS-intermod_pragma_clause = --intermodule-optimization
MCFLAGS-intermod_pragma_clause_sub = --intermodule-optimization
MCFLAGS-intermod_type_qual =	--intermodule-optimization
MCFLAGS-intermod_type_qual2 =	--intermodule-optimization
MCFLAGS-intermod_multimode =	--intermodule-optimization
MCFLAGS-intermod_multimode_main = --intermodule-optimization
MCFLAGS-lco_mday_bug_1	    =	--optimize-constructor-last-call
MCFLAGS-lco_mday_bug_2	    =	--optimize-constructor-last-call
MCFLAGS-lco_no_inline	    =	--optimize-constructor-last-call --no-inline-builtins
MCFLAGS-lookup_switch_simple_non = --no-warn-det-decls-too-lax
MCFLAGS-opt_format          =	--optimize-format-calls
MCFLAGS-reuse_ho            =	--ctgc --no-optimise-higher-order
MCFLAGS-sharing_comb	    =	--ctgc --structure-sharing-widening 2
MCFLAGS-simplify_multi_arm_switch = -O3
MCFLAGS-string_substring    =	--no-warn-obsolete
MCFLAGS-uncond_reuse	    =	--ctgc
MCFLAGS-uncond_reuse_bad    =	--ctgc
MCFLAGS-uo_regression1      =	--from-ground-term-threshold=4

# We disable intermodule-optimization here because it isn't compatible with
# intermodule-analysis.
#
MCFLAGS-intermod_unused_args =	--no-intermodule-optimization --intermodule-analysis --optimise-unused-args
MCFLAGS-intermod_unused_args2 = --no-intermodule-optimization --intermodule-analysis --optimise-unused-args

MCFLAGS-loop_inv_test 	= 	--loop-invariants --trace-optimized
MCFLAGS-loop_inv_test0 	= 	--loop-invariants --trace-optimized
MCFLAGS-loop_inv_test1 	= 	--loop-invariants --trace-optimized
MCFLAGS-loop_inv_test2 	= 	--loop-invariants --trace-optimized
MCFLAGS-loop_inv_test3 	= 	--loop-invariants
MCFLAGS-loop_inv_test4 	= 	--loop-invariants
MCFLAGS-prince_frameopt = 		--intermodule-optimization -O5
MCFLAGS-prince_frameopt_css = 		--intermodule-optimization -O5
MCFLAGS-prince_frameopt_css.style = 	--intermodule-optimization -O5

# Compile string_switch with both binary and hash switches effectively
# disabled, to test the basic indexing algorithm.
# Compile string_switch2 with only hash switches effectively disabled,
# to test the binary search algorithm.
# Compile string_switch3 with only binary search switches effectively disabled,
# to test the hash search algorithm.
MCFLAGS-string_switch   =	\
	--string-binary-switch-size=100 --string-hash-switch-size=100
MCFLAGS-string_switch2  =	\
	--string-binary-switch-size=2   --string-hash-switch-size=100
MCFLAGS-string_switch3  =	\
	--string-binary-switch-size=100 --string-hash-switch-size=2

# This bug only shows up at optimization levels -O2 and below.
#
MCFLAGS-profdeep_seg_fault = -O2

MCFLAGS-puzzle_detism_bug = 	--trace-optimized --inlining
MCFLAGS-no_inline_builtins =	--no-inline-builtins
MCFLAGS-no_warn_singleton =	--halt-at-warn
MCFLAGS-nondet_copy_out =	--no-inlining --nondet-copy-out
MCFLAGS-opt_dup_bug	=	-O2 --optimize-dups --optimize-frames
MCFLAGS-redoip_clobber	=	--no-inlining
MCFLAGS-rnd		=	-O6

# These tests check that calls to initialisation predicates are correctly
# added to various constructs.  They only work of automatic initialisation
# of solver types is enabled.
MCFLAGS-solver_construction_init_test = --solver-type-auto-init
MCFLAGS-solver_disj_inits = --solver-type-auto-init
MCFLAGS-solver_ite_inits  = --solver-type-auto-init

MCFLAGS-switch_detect	=	--halt-at-warn
# The trace_goal_1 and trace_goal_2 test cases differ only in that
# we compile the latter without any --trace-flag arguments.
MCFLAGS-trace_goal_1	=	--trace-flag=abc --trace-flag def
MCFLAGS-trace_goal_env_1 =	--trace-flag=abc
MCFLAGS-trace_goal_env_2 =	--trace-flag=abc
MCFLAGS-trace_goal_3 = --trace-flag=abc
MCFLAGS-trans_intermod_user_equality = --intermodule-optimization \
				--transitive-intermodule-optimization
MCFLAGS-trans_intermod_user_equality2 = --intermodule-optimization \
				--transitive-intermodule-optimization
MCFLAGS-trans_intermod_user_equality3 = --intermodule-optimization \
				--transitive-intermodule-optimization
MCFLAGS-type_qual	= 	--infer-all --from-ground-term-threshold=4
MCFLAGS-type_spec	=	--user-guided-type-specialization
MCFLAGS-existential_types_test = --infer-all
MCFLAGS-existential_float = --infer-all
MCFLAGS-user_defined_equality	= --infer-all
MCFLAGS-parse		=	--trace rep
MCFLAGS-unused_float_box_test =	--infer-all

MCFLAGS-target_mlobjs	= 	--pre-link-command "mmake target_mlobjs_c.o"
MLOBJS-target_mlobjs	=	target_mlobjs_c.o

# In grade `none' with options `-O1 --opt-space' on kryten
# (a sparc-sun-solaris2.5 system), mode_choice needs to be linked
# with `--no-strip', otherwise it gets a seg fault. 
# The test case ../hard_coded/string_test suffers from a similar problem.
# This is probably a bug in one of the underlying tools (e.g. the Solaris
# linker) rather than a bug in Mercury, and since it is goes away when you
# compile with debugging information, it is very difficult to debug.
# It is much easier to just work around it this way rather than
# tracking it down.
MLFLAGS-mode_choice = --no-strip

# parse.m gets compiled with --trace rep and linked with --trace because
# it is a regression test for a bug that only showed up with tracing enabled.
# It needs to be compiled with --no-pic-reg, since it is linked
# statically.  I have no idea why it gets linked statically.
# However, currently it is the only test case we have which gets linked
# statically, and we do want to have at least one test case to test
# static linking.
MGNUCFLAGS-parse	=	--no-pic-reg
MGNUCFLAGS-parse_init	=	--no-pic-reg
MLFLAGS-parse		=	--trace --static

MLFLAGS-split-c-files	=	--trace

MLFLAGS-needs_init	= 	--include-initialization-code --extra-inits

# These tests run out of memory in non-GC grades
# unless we increase the heap size from the default 4M.
# The sizes specified here (70 Mb and 20 Mb respectively)
# are sufficient for running these tests on 64-bit systems.
# The setting of `--mdb-out' tests the quoting of runtime
# options containing special characters.

MLFLAGS-integer_test = \
		--runtime-flags "--heap-size 70000 --mdb-out \"mdb\\mdb out\""
MLFLAGS-rational_test = --runtime-flags "--heap-size 20000"

MCFLAGS-constant_prop_1 = --optimize-constant-propagation \
		--trace-optimized
MCFLAGS-constant_prop_2 = --optimize-constant-propagation \
		--optimize-dead-procs --trace-optimized
