ghc 2.78 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
44
config.unregisterised = (ghc_unregisterised == 1)

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

50
51
config.way_flags = {
	'normal'     : [],
52
	'optc'       : ['-O -fvia-C'],
53
	'optasm'     : ['-O -fasm'],
54
	'profc'      : ['-O -prof -auto-all -fvia-C'],
55
56
57
58
	'profasm'    : ['-O -prof -auto-all -fasm'],
	'ghci'       : ['--interactive', '-v0'],
	'extcore'    : ['-fext-core'],
	'optextcore' : ['-O -fext-core'],
59
	'threaded1'  : ['-threaded', '-debug'],
andy@galois.com's avatar
andy@galois.com committed
60
	'threaded2'  : ['-O', '-threaded'],
61
62
63
64
65
66
	'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']
67
68
69
70
	}

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

88
89
90
91
92
93
94
95
96
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:]