Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 1 | import lit.formats |
| 2 | import os |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 3 | |
| 4 | config.name = 'cfi' |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 5 | config.suffixes = ['.c', '.cpp', '.test'] |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 6 | config.test_source_root = os.path.dirname(__file__) |
| 7 | |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 8 | clangxx = ' '.join([config.clang] + config.cxx_mode_flags) |
| 9 | |
| 10 | config.substitutions.append((r"%clangxx ", clangxx + ' ')) |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 11 | if config.lto_supported: |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 12 | clangxx_cfi = ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-flto -fsanitize=cfi ']) |
| 13 | clangxx_cfi_diag = clangxx_cfi + '-fno-sanitize-trap=cfi -fsanitize-recover=cfi ' |
| 14 | config.substitutions.append((r"%clangxx_cfi ", clangxx_cfi)) |
| 15 | config.substitutions.append((r"%clangxx_cfi_diag ", clangxx_cfi_diag)) |
| 16 | config.substitutions.append((r"%clangxx_cfi_dso ", clangxx_cfi + '-fsanitize-cfi-cross-dso ')) |
| 17 | config.substitutions.append((r"%clangxx_cfi_dso_diag ", clangxx_cfi_diag + '-fsanitize-cfi-cross-dso ')) |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 18 | else: |
| 19 | config.unsupported = True |
| 20 | |
| 21 | if lit_config.params.get('check_supported', None) and config.unsupported: |
| 22 | raise BaseException("Tests unsupported") |