2015-02-21 04:31:18 +08:00
|
|
|
import lit.formats
|
|
|
|
import os
|
|
|
|
|
|
|
|
config.name = 'cfi'
|
2015-09-10 10:18:02 +08:00
|
|
|
config.suffixes = ['.c', '.cpp', '.test']
|
2015-02-21 04:31:18 +08:00
|
|
|
config.test_source_root = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
clangxx = ' '.join([config.clang] + config.cxx_mode_flags)
|
|
|
|
|
|
|
|
config.substitutions.append((r"%clangxx ", clangxx + ' '))
|
2015-11-21 00:29:53 +08:00
|
|
|
if config.host_os == 'Windows':
|
|
|
|
# FIXME: Keep these tests working on Windows.
|
|
|
|
config.unsupported = True
|
|
|
|
elif config.lto_supported:
|
2015-06-20 03:48:40 +08:00
|
|
|
clangxx_cfi = ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-flto -fsanitize=cfi '])
|
2015-06-19 09:52:55 +08:00
|
|
|
config.substitutions.append((r"%clangxx_cfi ", clangxx_cfi))
|
|
|
|
config.substitutions.append((r"%clangxx_cfi_diag ", clangxx_cfi + '-fno-sanitize-trap=cfi -fsanitize-recover=cfi '))
|
2015-02-21 04:31:18 +08:00
|
|
|
else:
|
|
|
|
config.unsupported = True
|
2015-02-26 04:14:05 +08:00
|
|
|
|
|
|
|
if lit_config.params.get('check_supported', None) and config.unsupported:
|
|
|
|
raise BaseException("Tests unsupported")
|