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
|
# Tests for various scenarios in multi module compilation when code generation
# options (-fasm, -fllvm, -fobject-code, -fbyte-code) are used via OPTIONS_GHC
# pragma
# (Only one of the llvm way is sufficient to test these)
# Basic working of overriding 'backend' via OPTIONS_GHC
test('options_ghc_fasm_fllvm',
[ when(fast(), skip),
only_ways(['llvm', 'ghci']),
extra_files(['Mod_fasm.hs', 'Mod_fllvm.hs', 'Mod_fasm_fllvm.hs'])],
multimod_compile,
['Mod_fasm_fllvm', ''])
# Test that llvm is indeed getting used
test('options_ghc_fasm_fllvm_2',
[ when(fast(), skip),
only_ways(['llvm']),
extra_files(['Mod_fasm.hs', 'Mod_fllvm.hs', 'Mod_fasm_fllvm.hs'])],
multimod_compile_fail,
['Mod_fasm_fllvm', '-optlc -SOMETHING_INVALID'])
# This should compile, as llvm should not be used with -fasm override
test('options_ghc_fasm',
[ when(fast(), skip),
only_ways(['llvm']),
extra_files(['Mod_fasm.hs'])],
multimod_compile,
['Mod_fasm', '-optlc -SOMETHING_INVALID'])
# Should cause object-code creation
test('options_ghc_fobject-code',
[ when(fast(), skip),
only_ways(['ghci']),
extra_files(['Mod_fasm.hs', 'Mod_fllvm.hs', 'Mod_fbyte_code.hs', 'Mod_fobject_code.hs', 'Mod_top.hs', 'Load_Mod_top.script'])],
ghci_script,
['Load_Mod_top.script'])
# Should override the -fbyte-code in normal compile
test('options_ghc_fbyte-code',
[ when(fast(), skip),
only_ways(['llvm']),
extra_files(['Mod_fasm.hs', 'Mod_fllvm.hs', 'Mod_fbyte_code.hs', 'Mod_fobject_code.hs', 'Mod_top.hs'])],
multimod_compile,
['Mod_top', ''])
|