Skip to content

Commit

Permalink
Merged master:918e6531863 into amd-gfx:1bebf3cd354
Browse files Browse the repository at this point in the history
Local branch amd-gfx 1bebf3c Merged master:3cca818efab into amd-gfx:2165191f92e
Remote branch master 918e653 [X86] Immediately call LowerShift from lowerBuildVectorToBitOp.
  • Loading branch information
Sw authored and Sw committed Jul 9, 2020
2 parents 1bebf3c + 918e653 commit 5077035
Show file tree
Hide file tree
Showing 59 changed files with 1,765 additions and 656 deletions.
470 changes: 0 additions & 470 deletions clang/include/clang/Driver/CLCompatOptions.td

This file was deleted.

1,407 changes: 1,405 additions & 2 deletions clang/include/clang/Driver/Options.td

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions compiler-rt/test/builtins/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@

import lit.formats

# Choose between lit's internal shell pipeline runner and a real shell. If
# LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
if use_lit_shell:
# 0 is external, "" is default, and everything else is internal.
execute_external = (use_lit_shell == "0")
else:
# Otherwise we default to internal on Windows and external elsewhere, as
# bash on Windows is usually very slow.
execute_external = (not sys.platform in ['win32'])

def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if attr_value == None:
Expand Down Expand Up @@ -35,10 +46,16 @@ def get_required_attr(config, attr_name):
else:
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
% config.target_suffix)
if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
base_lib = base_lib.replace('\\', '/')
config.substitutions.append( ("%librt ", base_lib + ' -lc -lm ') )

builtins_source_dir = os.path.join(
get_required_attr(config, "compiler_rt_src_root"), "lib", "builtins")
if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
builtins_source_dir = builtins_source_dir.replace('\\', '/')
builtins_lit_source_dir = get_required_attr(config, "builtins_lit_source_dir")

extra_link_flags = ["-nodefaultlibs"]
Expand Down
17 changes: 11 additions & 6 deletions compiler-rt/test/crt/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ def get_library_path(file):
config.target_cflags.strip(),
'-print-file-name=%s' % file],
stdout=subprocess.PIPE,
env=config.environment)
env=config.environment,
universal_newlines=True)
if not cmd.stdout:
lit_config.fatal("Couldn't find the library path for '%s'" % file)
dir = cmd.stdout.read().strip()
if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
dir = dir.replace('\\', '/')
# Ensure the result is an ascii string, across Python2.5+ - Python3.
return str(dir.decode('ascii'))
return dir


def get_libgcc_file_name():
cmd = subprocess.Popen([config.clang.strip(),
config.target_cflags.strip(),
'-print-libgcc-file-name'],
stdout=subprocess.PIPE,
env=config.environment)
env=config.environment,
universal_newlines=True)
if not cmd.stdout:
lit_config.fatal("Couldn't find the library path for '%s'" % file)
dir = cmd.stdout.read().strip()
if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
dir = dir.replace('\\', '/')
# Ensure the result is an ascii string, across Python2.5+ - Python3.
return str(dir.decode('ascii'))
return dir


def build_invocation(compile_flags):
Expand All @@ -66,6 +66,11 @@ def build_invocation(compile_flags):

base_lib = os.path.join(
config.compiler_rt_libdir, "clang_rt.%%s%s.o" % config.target_suffix)

if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
base_lib = base_lib.replace('\\', '/')

config.substitutions.append(('%crtbegin', base_lib % "crtbegin"))
config.substitutions.append(('%crtend', base_lib % "crtend"))

Expand Down
5 changes: 5 additions & 0 deletions compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
# bash on Windows is usually very slow.
execute_external = (not sys.platform in ['win32'])

# Allow expanding substitutions that are based on other substitutions
config.recursiveExpansionLimit = 10

# Setup test format.
config.test_format = lit.formats.ShTest(execute_external)
if execute_external:
Expand Down Expand Up @@ -67,6 +70,8 @@
# to link. In r19 and later we just use the default which is libc++.
config.cxx_mode_flags.append('-stdlib=libstdc++')

config.environment = dict(os.environ)

# Clear some environment variables that might affect Clang.
possibly_dangerous_env_vars = ['ASAN_OPTIONS', 'DFSAN_OPTIONS', 'LSAN_OPTIONS',
'MSAN_OPTIONS', 'UBSAN_OPTIONS',
Expand Down
2 changes: 2 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library
option(LIBCXX_TEST_GDB_PRETTY_PRINTERS "Test gdb pretty printers." OFF)
set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
"The Lit testing configuration to use when running the tests.")
set(LIBCXX_TEST_PARAMS "" CACHE STRING
"A list of parameters to run the Lit test suite with.")

# Benchmark options -----------------------------------------------------------
option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependencies" ON)
Expand Down
3 changes: 2 additions & 1 deletion libcxx/cmake/caches/Generic-cxx03.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(LLVM_LIT_ARGS "--param std=c++03" CACHE STRING "")
set(LIBCXX_TEST_PARAMS "std=c++03" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
3 changes: 2 additions & 1 deletion libcxx/cmake/caches/Generic-cxx11.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(LLVM_LIT_ARGS "--param std=c++11" CACHE STRING "")
set(LIBCXX_TEST_PARAMS "std=c++11" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
3 changes: 2 additions & 1 deletion libcxx/cmake/caches/Generic-cxx14.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(LLVM_LIT_ARGS "--param std=c++14" CACHE STRING "")
set(LIBCXX_TEST_PARAMS "std=c++14" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
3 changes: 2 additions & 1 deletion libcxx/cmake/caches/Generic-cxx17.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(LLVM_LIT_ARGS "--param std=c++17" CACHE STRING "")
set(LIBCXX_TEST_PARAMS "std=c++17" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
3 changes: 2 additions & 1 deletion libcxx/cmake/caches/Generic-cxx2a.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(LLVM_LIT_ARGS "--param std=c++2a" CACHE STRING "")
set(LIBCXX_TEST_PARAMS "std=c++2a" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
26 changes: 5 additions & 21 deletions libcxx/docs/TestingLibcxx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ default.

Specify the compiler used to build the tests.

.. option:: cxx_stdlib_under_test=<stdlib name>
.. option:: stdlib=<stdlib name>

**Values**: libc++, libstdc++
**Values**: libc++, libstdc++, msvc

Specify the C++ standard library being tested. Unless otherwise specified
libc++ is used. This option is intended to allow running the libc++ test
suite against other standard library implementations.
Specify the C++ standard library being tested. The default is libc++ if this
option is not provided. This option is intended to allow running the libc++
test suite against other standard library implementations.

.. option:: std=<standard version>

Expand Down Expand Up @@ -151,22 +151,6 @@ default.
still be used to specify the path of the library to link to and run against,
respectively.

.. option:: use_lit_shell=<bool>

Enable or disable the use of LIT's internal shell in ShTests. If the
environment variable LIT_USE_INTERNAL_SHELL is present then that is used as
the default value. Otherwise the default value is True on Windows and False
on every other platform.

.. option:: compile_flags="<list-of-args>"

Specify additional compile flags as a space delimited string.
Note: This options should not be used to change the standard version used.

.. option:: link_flags="<list-of-args>"

Specify additional link flags as a space delimited string.

.. option:: debug_level=<level>

**Values**: 0, 1
Expand Down
7 changes: 4 additions & 3 deletions libcxx/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if(LIBCXX_TEST_GDB_PRETTY_PRINTERS)
endif()

if (LIBCXX_INCLUDE_TESTS)
include(AddLLVM) # for configure_lit_site_cfg and add_lit_testsuite
include(AddLLVM) # for configure_lit_site_cfg and add_lit_target

configure_lit_site_cfg(
"${LIBCXX_TEST_CONFIG}"
Expand All @@ -114,10 +114,11 @@ if (LIBCXX_INCLUDE_TESTS)
DEPENDS cxx ${LIBCXX_TEST_DEPS}
COMMENT "Builds dependencies required to run the test suite.")

add_lit_testsuite(check-cxx
add_lit_target(check-cxx
"Running libcxx tests"
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS check-cxx-deps)
DEPENDS check-cxx-deps
PARAMS "${LIBCXX_TEST_PARAMS}")
endif()

if (LIBCXX_GENERATE_COVERAGE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <experimental/coroutine>

#include "test_macros.h"

namespace coro = std::experimental::coroutines_v1;

coro::suspend_always sa;
Expand All @@ -25,7 +27,7 @@ struct MyFuture {
struct promise_type {
typedef coro::coroutine_handle<promise_type> HandleT;
coro::suspend_never initial_suspend() { return sn; }
coro::suspend_always final_suspend() noexcept { return sa; }
coro::suspend_always final_suspend() TEST_NOEXCEPT { return sa; }
coro::suspend_never yield_value(int) { return sn; }
MyFuture get_return_object() {
MyFuture f(HandleT::from_promise(*this));
Expand Down
31 changes: 1 addition & 30 deletions libcxx/utils/libcxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def __init__(self, lit_config, config):
self.use_target = False
self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib', False)
self.use_clang_verify = False
self.long_tests = None

def get_lit_conf(self, name, default=None):
val = self.lit_config.params.get(name, None)
Expand Down Expand Up @@ -126,7 +125,7 @@ def configure(self):
self.configure_deployment()
self.configure_src_root()
self.configure_obj_root()
self.configure_cxx_stdlib_under_test()
self.cxx_stdlib_under_test = self.get_lit_conf('cxx_stdlib_under_test', 'libc++')
self.cxx_library_root = self.get_lit_conf('cxx_library_root', self.libcxx_obj_root)
self.abi_library_root = self.get_lit_conf('abi_library_path', None)
self.cxx_runtime_root = self.get_lit_conf('cxx_runtime_root', self.cxx_library_root)
Expand Down Expand Up @@ -257,22 +256,6 @@ def configure_obj_root(self):
else:
self.libcxx_obj_root = self.project_obj_root

def configure_cxx_stdlib_under_test(self):
self.cxx_stdlib_under_test = self.get_lit_conf(
'cxx_stdlib_under_test', 'libc++')
if self.cxx_stdlib_under_test not in \
['libc++', 'libstdc++', 'msvc', 'cxx_default']:
self.lit_config.fatal(
'unsupported value for "cxx_stdlib_under_test": %s'
% self.cxx_stdlib_under_test)
self.config.available_features.add(self.cxx_stdlib_under_test)
if self.cxx_stdlib_under_test == 'libstdc++':
# Manually enable the experimental and filesystem tests for libstdc++
# if the options aren't present.
# FIXME this is a hack.
if self.get_lit_conf('enable_experimental') is None:
self.config.enable_experimental = 'true'

def configure_features(self):
additional_features = self.get_lit_conf('additional_features')
if additional_features:
Expand Down Expand Up @@ -301,18 +284,6 @@ def configure_features(self):
self.config.available_features.add('availability=%s' % name)
self.config.available_features.add('availability=%s%s' % (name, version))

# Simulator testing can take a really long time for some of these tests
# so add a feature check so we can REQUIRES: long_tests in them
self.long_tests = self.get_lit_bool('long_tests')
if self.long_tests is None:
# Default to running long tests.
self.long_tests = True
self.lit_config.note(
"inferred long_tests as: %r" % self.long_tests)

if self.long_tests:
self.config.available_features.add('long_tests')

if self.target_info.is_windows():
if self.cxx_stdlib_under_test == 'libc++':
# LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the
Expand Down
8 changes: 8 additions & 0 deletions libcxx/utils/libcxx/test/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@
feature=lambda exceptions: None if exceptions else
Feature(name='no-exceptions', compileFlag='-fno-exceptions')),

Parameter(name='stdlib', choices=['libc++', 'libstdc++', 'msvc'], type=str, default='libc++',
help="The C++ Standard Library implementation being tested.",
feature=lambda stdlib: Feature(name=stdlib)),

# Parameters to enable or disable parts of the test suite
Parameter(name='enable_filesystem', choices=[True, False], type=bool, default=True,
help="Whether to enable tests for the C++ <filesystem> library.",
feature=lambda filesystem: None if filesystem else
Feature(name='c++filesystem-disabled')),

Parameter(name='long_tests', choices=[True, False], type=bool, default=True,
help="Whether to tests that take longer to run. This can be useful when running on a very slow device.",
feature=lambda enabled: Feature(name='long_tests') if enabled else None),
]
7 changes: 0 additions & 7 deletions libcxx/utils/libcxx/test/target_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def is_darwin(self):
def add_cxx_compile_flags(self, flags): pass
def add_cxx_link_flags(self, flags): pass
def allow_cxxabi_link(self): return True
def use_lit_shell_default(self): return False

def add_path(self, dest_env, new_path):
if not new_path:
Expand Down Expand Up @@ -210,12 +209,6 @@ class WindowsLocalTI(DefaultTargetInfo):
def __init__(self, full_config):
super(WindowsLocalTI, self).__init__(full_config)

def use_lit_shell_default(self):
# Default to the internal shell on Windows, as bash on Windows is
# usually very slow.
return True


def make_target_info(full_config):
default = "libcxx.test.target_info.LocalTI"
info_str = full_config.get_lit_conf('target_info', default)
Expand Down
2 changes: 2 additions & 0 deletions libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ option(LIBCXXABI_HERMETIC_STATIC_LIBRARY

set(LIBCXXABI_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
"The Lit testing configuration to use when running the tests.")
set(LIBCXXABI_TEST_PARAMS "" CACHE STRING
"A list of parameters to run the Lit test suite with.")

#===============================================================================
# Configure System
Expand Down
7 changes: 4 additions & 3 deletions libcxxabi/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include(AddLLVM) # for add_lit_testsuite
include(AddLLVM) # for configure_lit_site_cfg and add_lit_target
macro(pythonize_bool var)
if (${var})
set(${var} True)
Expand Down Expand Up @@ -76,6 +76,7 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")

add_lit_testsuite(check-cxxabi "Running libcxxabi tests"
add_lit_target(check-cxxabi "Running libcxxabi tests"
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${LIBCXXABI_TEST_DEPS})
DEPENDS ${LIBCXXABI_TEST_DEPS}
PARAMS "${LIBCXXABI_TEST_PARAMS}")
1 change: 1 addition & 0 deletions lld/test/ELF/ppc64-error-toc-local-call.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# REQUIRES: ppc
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s

Expand Down
Loading

0 comments on commit 5077035

Please sign in to comment.