Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 # -*- Python -*- | |
2 | |
3 import os | |
4 | |
5 def get_required_attr(config, attr_name): | |
6 attr_value = getattr(config, attr_name, None) | |
7 if not attr_value: | |
8 lit.fatal("No attribute %r in test configuration! You may need to run " | |
9 "tests from your build directory or add this attribute " | |
10 "to lit.site.cfg " % attr_name) | |
11 return attr_value | |
12 | |
13 # Setup attributes common for all compiler-rt projects. | |
14 llvm_src_root = get_required_attr(config, 'llvm_src_root') | |
15 compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt", | |
16 "lib", "lit.common.cfg") | |
17 lit.load_config(config, compiler_rt_lit_cfg) | |
18 | |
19 # Setup config name. | |
20 config.name = 'AddressSanitizer' | |
21 | |
22 # Setup source root. | |
23 config.test_source_root = os.path.dirname(__file__) | |
24 | |
25 # Setup default compiler flags used with -faddress-sanitizer option. | |
chandlerc
2012/07/31 08:40:41
Are all of these really required?
| |
26 clang_asan_cxxflags = ("-faddress-sanitizer " | |
27 + "-mno-omit-leaf-frame-pointer " | |
28 + "-fno-omit-frame-pointer " | |
29 + "-fno-optimize-sibling-calls " | |
30 + "-g") | |
31 config.substitutions.append( ("%clang_asan ", (" " + config.clang + " " + | |
32 clang_asan_cxxflags + " ")) ) | |
33 | |
34 # Setup path to symbolizer script. | |
35 asan_source_dir = os.path.join(config.test_source_root, "..") | |
36 symbolizer = os.path.join(asan_source_dir, | |
37 'scripts', 'asan_symbolize.py') | |
38 if not os.path.exists(symbolizer): | |
39 lit.fatal("Can't find symbolizer script on path %r" % symbolizer) | |
chandlerc
2012/07/31 08:40:41
Any reason why not to pull this from the .site.cfg
| |
40 config.substitutions.append( ('%symbolizer', (" " + symbolizer + " " ))) | |
41 | |
42 # Default test suffixes. | |
43 config.suffixes = ['.c', '.cc', '.cpp'] | |
OLD | NEW |