Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 1 | # -*- Python -*- |
| 2 | |
| 3 | import os |
| 4 | |
| 5 | # Setup config name. |
| 6 | config.name = 'SafeStack' |
| 7 | |
| 8 | # Setup source root. |
| 9 | config.test_source_root = os.path.dirname(__file__) |
| 10 | |
| 11 | # Test suffixes. |
| 12 | config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] |
| 13 | |
| 14 | # Add clang substitutions. |
| 15 | config.substitutions.append( ("%clang_nosafestack ", config.clang + " -O0 -fno-sanitize=safe-stack ") ) |
| 16 | config.substitutions.append( ("%clang_safestack ", config.clang + " -O0 -fsanitize=safe-stack ") ) |
| 17 | |
| 18 | if config.lto_supported: |
| 19 | config.available_features.add('lto') |
| 20 | config.substitutions.append((r"%clang_lto_safestack ", ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-flto -fsanitize=safe-stack ']))) |
| 21 | |
| 22 | # SafeStack tests are currently supported on Linux, FreeBSD and Darwin only. |
| 23 | if config.host_os not in ['Linux', 'FreeBSD', 'Darwin']: |
| 24 | config.unsupported = True |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 25 | |
| 26 | # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL |
| 27 | # because the test fail due some runtime issue. |
| 28 | if config.target_arch != 'aarch64': |
| 29 | config.available_features.add('stable-runtime') |