Skip to content

Commit

Permalink
llvm-project Mega-Update (#4263)
Browse files Browse the repository at this point in the history
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
  • Loading branch information
StephanTLavavej and cpplearner committed Dec 15, 2023
1 parent 7230fe4 commit e077eb6
Show file tree
Hide file tree
Showing 7 changed files with 682 additions and 442 deletions.
2 changes: 1 addition & 1 deletion llvm-project
1,100 changes: 662 additions & 438 deletions tests/libcxx/expected_results.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/libcxx/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ config.suffixes = ['[.]pass[.]cpp$', '[.]fail[.]cpp$']
config.test_exec_root = '@LIBCXX_TEST_OUTPUT_DIR@'
config.test_format = stl.test.format.LibcxxTestFormat()
config.test_source_root = '@LIBCXX_SOURCE_DIR@/test'
config.substitutions.append(('%{cxx_std}', ''))

lit_config.expected_results = getattr(lit_config, 'expected_results', dict())
lit_config.include_dirs = getattr(lit_config, 'include_dirs', dict())
Expand Down
1 change: 1 addition & 0 deletions tests/std/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config.name = 'std'
config.suffixes = ['test[.]cpp$', 'test[.]compile[.]pass[.]cpp$']
config.test_exec_root = "@STD_TEST_OUTPUT_DIR@"
config.test_format = stl.test.format.STLTestFormat()
config.substitutions.append(('%{cxx_std}', ''))

lit_config.expected_results = getattr(lit_config, 'expected_results', dict())
lit_config.include_dirs = getattr(lit_config, 'include_dirs', dict())
Expand Down
1 change: 1 addition & 0 deletions tests/tr1/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config.name = 'tr1'
config.suffixes = ['test[.]cpp$']
config.test_exec_root = "@TR1_TEST_OUTPUT_DIR@"
config.test_format = stl.test.format.STLTestFormat()
config.substitutions.append(('%{cxx_std}', ''))

lit_config.expected_results = getattr(lit_config, 'expected_results', dict())
lit_config.include_dirs = getattr(lit_config, 'include_dirs', dict())
Expand Down
6 changes: 5 additions & 1 deletion tests/utils/stl/test/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def hasLocale(loc):
locale.setlocale(locale.LC_ALL, default_locale)

def getDefaultFeatures(config, litConfig):
DEFAULT_FEATURES = [Feature(name='msvc'), Feature(name='windows')]
DEFAULT_FEATURES = [
Feature(name='has-64-bit-atomics'),
Feature(name='msvc'),
Feature(name='windows'),
]
locales = {
'en_US.UTF-8': ['en_US.UTF-8', 'en_US.utf8', 'English_United States.1252'],
'fr_FR.UTF-8': ['fr_FR.UTF-8', 'fr_FR.utf8', 'French_France.1252'],
Expand Down
13 changes: 11 additions & 2 deletions tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,18 @@ def _parseTest(self):
lit.TestRunner.ParserKind.LIST,
initial_value=fileDependencies),
lit.TestRunner.IntegratedTestKeywordParser('ADDITIONAL_COMPILE_FLAGS:',
lit.TestRunner.ParserKind.LIST,
lit.TestRunner.ParserKind.SPACE_LIST,
initial_value=additionalCompileFlags)
]

for feature in self.config.available_features:
parser = lit.TestRunner.IntegratedTestKeywordParser(
"ADDITIONAL_COMPILE_FLAGS({}):".format(feature),
lit.TestRunner.ParserKind.SPACE_LIST,
initial_value=additionalCompileFlags,
)
parsers.append(parser)

lit.TestRunner.parseIntegratedTestScript(self, additional_parsers=parsers, require_script=False)
self.compileFlags.extend(additionalCompileFlags)
self.fileDependencies.extend(fileDependencies)
Expand Down Expand Up @@ -214,6 +222,7 @@ def _handleEnvlst(self, litConfig):

if ('clang'.casefold() in os.path.basename(cxx).casefold()):
self._addCustomFeature('clang')
self._addCustomFeature('gcc-style-warnings')

targetArch = litConfig.target_arch.casefold()
if (targetArch == 'x64'.casefold()):
Expand All @@ -230,7 +239,7 @@ def _handleEnvlst(self, litConfig):
# nvcc only supports targeting x64
self.requires.append('x64')
else:
self._addCustomFeature('cl')
self._addCustomFeature('cl-style-warnings')

self.cxx = os.path.normpath(cxx)
return None
Expand Down

0 comments on commit e077eb6

Please sign in to comment.