ghc 2.73 KB
Newer Older
1 2 3 4

import os
import re

5 6 7 8 9 10
# Testsuite configuration setup for GHC
#
# This file is Python source
#
config.compiler_type         = 'ghc'
config.compiler              = 'ghc'
11
config.compiler_always_flags = ['-no-recomp', '-dcore-lint', '-dcmm-lint']
12

13 14 15 16
config.hp2ps		     = 'hp2ps'
config.gs		     = 'gs'
config.confdir               = '.'

andy@galois.com's avatar
andy@galois.com committed
17
# By default, we test the 'normal', 'opt' and 'hpc' ways.
18 19
# 'optasm' is added by mk/test.mk if the compiler has a native code gen,
# 'prof'   is added by mk/test.mk if the profiling way is enabled.
20 21
config.compile_ways	     = ['normal', 'optc', 'hpc']
config.run_ways		     = ['normal', 'optc', 'hpc']
22

krc's avatar
krc committed
23
# ways that are not enabled by default, but can always be invoked explicitly
24 25 26
config.other_ways            = ['extcore','optextcore',
                                'prof_hc_hb','prof_hb',
                                'prof_hd','prof_hy','prof_hr']
krc's avatar
krc committed
27

28 29 30 31 32
if (ghc_with_native_codegen == 1):
	config.compile_ways.append('optasm')
	config.run_ways.append('optasm')

if (ghc_with_profiling == 1):
33
	config.have_profiling = True
34 35
	config.compile_ways.append('profc')
	config.run_ways.append('profc')
36 37 38
	if (ghc_with_native_codegen == 1):
		config.compile_ways.append('profasm')
		config.run_ways.append('profasm')
39

40 41 42
if (ghc_with_interpreter == 1):
	config.run_ways.append('ghci')

43
if (ghc_with_threaded_rts == 1):
44
	config.run_ways.append('threaded1')
45 46
	if (ghc_with_smp == 1):
		config.run_ways.append('threaded2')
47

48 49
config.way_flags = {
	'normal'     : [],
50
	'optc'       : ['-O -fvia-C'],
51
	'optasm'     : ['-O -fasm'],
52
	'profc'      : ['-O -prof -auto-all -fvia-C'],
53 54 55 56
	'profasm'    : ['-O -prof -auto-all -fasm'],
	'ghci'       : ['--interactive', '-v0'],
	'extcore'    : ['-fext-core'],
	'optextcore' : ['-O -fext-core'],
57
	'threaded1'  : ['-threaded', '-debug'],
andy@galois.com's avatar
andy@galois.com committed
58
	'threaded2'  : ['-O', '-threaded'],
59 60 61 62 63 64
	'hpc'	     : ['-O', '-fhpc' ],
        'prof_hc_hb' : ['-O -prof -auto-all'],
        'prof_hb'    : ['-O -prof -auto-all'],
        'prof_hd'    : ['-O -prof -auto-all'],
        'prof_hy'    : ['-O -prof -auto-all'],
        'prof_hr'    : ['-O -prof -auto-all']
65 66 67 68
	}

config.way_rts_flags = { 
	'normal'     : [],
69
	'optc'       : [],
70
	'optasm'     : [],
71
	'profc'      : ['-p'],
72
	'profasm'    : ['-hc'], # test heap profiling too
73 74 75
	'ghci'       : [],
	'extcore'    : [],
	'optextcore' : [],
76
	'threaded1'  : [],
andy@galois.com's avatar
andy@galois.com committed
77
	'threaded2'  : ['-N2'],
78 79 80 81 82 83
	'hpc'	     : [],
        'prof_hc_hb' : ['-hc -hbvoid'],
        'prof_hb'    : ['-hb'],
        'prof_hd'    : ['-hd'],
        'prof_hy'    : ['-hy'],
        'prof_hr'    : ['-hr']
84
    	}
85

86 87 88 89 90 91 92 93 94
def get_compiler_info():
    h = os.popen(config.compiler + ' --numeric-version', 'r')
    v = h.read()
    h.close()
    v = re.sub('[\r\n]', '', v)
    v = v.split('-')
    config.compiler_version = v[0]
    config.compiler_tags = v[1:]