import lit.formats
import os

config.name = 'cfi'
config.suffixes = ['.cpp']
config.test_source_root = os.path.dirname(__file__)

clangxx = ' '.join([config.clang] + config.cxx_mode_flags)

config.substitutions.append((r"%clangxx ", clangxx + ' '))
if config.lto_supported:
  clangxx_cfi = ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-fsanitize=cfi '])
  config.substitutions.append((r"%clangxx_cfi ", clangxx_cfi))
  config.substitutions.append((r"%clangxx_cfi_diag ", clangxx_cfi + '-fno-sanitize-trap=cfi -fsanitize-recover=cfi '))
else:
  config.unsupported = True

if lit_config.params.get('check_supported', None) and config.unsupported:
  raise BaseException("Tests unsupported")

import lit.formats
import os

config.name = 'cfi'
config.suffixes = ['.cpp']
config.test_source_root = os.path.dirname(__file__)

clangxx = ' '.join([config.clang] + config.cxx_mode_flags)

config.substitutions.append((r"%clangxx ", clangxx + ' '))
if config.lto_supported:
  clangxx_cfi = ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-flto -fsanitize=cfi '])
  config.substitutions.append((r"%clangxx_cfi ", clangxx_cfi))
  config.substitutions.append((r"%clangxx_cfi_diag ", clangxx_cfi + '-fno-sanitize-trap=cfi -fsanitize-recover=cfi '))
else:
  config.unsupported = True

if lit_config.params.get('check_supported', None) and config.unsupported:
  raise BaseException("Tests unsupported")

Add -flto to clang flags for cfi tests.
Add -flto to clang flags for cfi tests.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@240168 91177308-0d34-0410-b5e6-96231b3b80d8
