1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
import os
import re
# Testsuite configuration setup for GHC
#
# This file is Python source
#
config.compiler_type = 'ghc'
config.compiler = 'ghc'
config.compiler_always_flags = ['-fforce-recomp', '-dcore-lint', '-dcmm-lint', '-no-user-package-conf']
config.hp2ps = 'hp2ps'
config.hpc = 'hpc'
config.gs = 'gs'
config.confdir = '.'
# By default, we test the 'normal', 'opt' and 'hpc' ways.
# '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.
config.compile_ways = ['normal', 'optc', 'hpc']
config.run_ways = ['normal', 'optc', 'hpc']
# ways that are not enabled by default, but can always be invoked explicitly
config.other_ways = ['extcore','optextcore',
'prof_hc_hb','prof_hb',
'prof_hd','prof_hy','prof_hr',
'threaded2_qw']
if (ghc_with_native_codegen == 1):
config.compile_ways.append('optasm')
config.run_ways.append('optasm')
if (ghc_with_profiling == 1):
config.have_profiling = True
config.compile_ways.append('profc')
config.run_ways.append('profc')
if (ghc_with_native_codegen == 1):
config.compile_ways.append('profasm')
config.run_ways.append('profasm')
if (ghc_with_interpreter == 1):
config.run_ways.append('ghci')
config.unregisterised = (ghc_unregisterised == 1)
if (ghc_with_threaded_rts == 1):
config.run_ways.append('threaded1')
if (ghc_with_smp == 1):
config.run_ways.append('threaded2')
if (ghc_with_dynamic_rts == 1):
config.run_ways.append('dyn')
if (ghc_with_profiling == 1 and ghc_with_threaded_rts == 1):
config.run_ways.append('profthreaded')
config.way_flags = {
'normal' : [],
'optc' : ['-O -fvia-C'],
'optasm' : ['-O -fasm'],
'profc' : ['-O -prof -auto-all -fvia-C'],
'profasm' : ['-O -prof -auto-all -fasm'],
'profthreaded' : ['-O -prof -auto-all -fasm -threaded'],
'ghci' : ['--interactive', '-v0', '-ignore-dot-ghci', '+RTS', '-I0.1', '-RTS'],
'extcore' : ['-fext-core'],
'optextcore' : ['-O -fext-core'],
'threaded1' : ['-threaded', '-debug'],
'threaded2' : ['-O', '-threaded', '-eventlog'],
'threaded2_qw' : ['-O', '-threaded'],
'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'],
'dyn' : ['-O -dynamic']
}
config.way_rts_flags = {
'normal' : [],
'optc' : [],
'optasm' : [],
'profc' : ['-p'],
'profasm' : ['-hc'], # test heap profiling too
'profthreaded' : ['-p'],
'ghci' : [],
'extcore' : [],
'optextcore' : [],
'threaded1' : [],
'threaded2' : ['-N2 -ls'],
'threaded2_qw' : ['-N2', '-qw'],
'hpc' : [],
'prof_hc_hb' : ['-hc -hbvoid'],
'prof_hb' : ['-hb'],
'prof_hd' : ['-hd'],
'prof_hy' : ['-hy'],
'prof_hr' : ['-hr'],
'dyn' : []
}
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_maj_version = re.sub('^([0-9]+\.[0-9]+).*',r'\1', v[0])
config.compiler_tags = v[1:]
# remove profthreaded for GHC <6.9, it didn't work
if ('profthreaded' in config.run_ways) and version_lt(config.compiler_version, '6.9'):
config.run_ways.remove('profthreaded')
if version_ge(config.compiler_version, '6.9'):
config.compiler_always_flags.append('-dno-debug-output')
|