-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: ndk/run_tests.py Bug: android/ndk#421 Change-Id: I23b07ba8a064035bbc7dc4f2e1ec0e1ec85eb5c9
- Loading branch information
Showing
1,186 changed files
with
22,538 additions
and
15,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | |
project(libcxx CXX C) | ||
|
||
set(PACKAGE_NAME libcxx) | ||
set(PACKAGE_VERSION 4.0.0svn) | ||
set(PACKAGE_VERSION 6.0.0svn) | ||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") | ||
set(PACKAGE_BUGREPORT "[email protected]") | ||
|
||
|
@@ -64,8 +64,12 @@ option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." O | |
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) | ||
option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON) | ||
option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON) | ||
option(LIBCXX_ENABLE_FILESYSTEM | ||
"Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) | ||
set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) | ||
if (WIN32) | ||
set(ENABLE_FILESYSTEM_DEFAULT OFF) | ||
endif() | ||
option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a" | ||
${ENABLE_FILESYSTEM_DEFAULT}) | ||
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) | ||
|
||
# Benchmark options ----------------------------------------------------------- | ||
|
@@ -114,23 +118,22 @@ if (LIBCXX_CXX_ABI STREQUAL "default") | |
cxxabi.h | ||
PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include | ||
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include | ||
${LLVM_MAIN_SRC_DIR}/../libcxxabi/include | ||
NO_DEFAULT_PATH | ||
) | ||
if ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND | ||
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") | ||
if (LIBCXX_TARGETING_MSVC) | ||
# FIXME: Figure out how to configure the ABI library on Windows. | ||
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime") | ||
elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND | ||
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") | ||
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") | ||
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") | ||
set(LIBCXX_CXX_ABI_INTREE 1) | ||
elseif (APPLE) | ||
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") | ||
set(LIBCXX_CXX_ABI_SYSTEM 1) | ||
else() | ||
if (LIBCXX_TARGETING_MSVC) | ||
# FIXME: Figure out how to configure the ABI library on Windows. | ||
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime") | ||
elseif(APPLE) | ||
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") | ||
set(LIBCXX_CXX_ABI_SYSTEM 1) | ||
else() | ||
set(LIBCXX_CXX_ABI_LIBNAME "default") | ||
endif() | ||
set(LIBCXX_CXX_ABI_LIBNAME "default") | ||
endif() | ||
else() | ||
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}") | ||
|
@@ -142,7 +145,7 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF) | |
|
||
# Generate and install a linker script inplace of libc++.so. The linker script | ||
# will link libc++ to the correct ABI library. This option is on by default | ||
# On UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' | ||
# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' | ||
# is on. This option is also disabled when the ABI library is not specified | ||
# or is specified to be "none". | ||
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF) | ||
|
@@ -161,7 +164,7 @@ option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT | |
set(ENABLE_NEW_DELETE_DEFAULT ON) | ||
if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS) | ||
# FIXME: This option should default to off. Unfortunatly GCC 4.9 fails to link | ||
# programs to due undefined references to new/delete in libc++abi so to work | ||
# programs due to undefined references to new/delete in libc++abi so to work | ||
# around this libc++abi currently defaults LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS | ||
# to ON. Once the GCC bug has been worked around this option should be changed | ||
# back to OFF. | ||
|
@@ -342,11 +345,23 @@ set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER}) | |
set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build") | ||
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) | ||
if (LLVM_LIBRARY_OUTPUT_INTDIR) | ||
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) | ||
else() | ||
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) | ||
endif() | ||
file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") | ||
|
||
set(LIBCXX_INSTALL_PREFIX "" CACHE STRING | ||
"Define libc++ destination prefix.") | ||
|
||
if (NOT LIBCXX_INSTALL_PREFIX MATCHES "^$|.*/") | ||
message(FATAL_ERROR "LIBCXX_INSTALL_PREFIX has to end with \"/\".") | ||
endif() | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) | ||
|
||
# Declare libc++ configuration variables. | ||
# They are intended for use as follows: | ||
|
@@ -369,9 +384,9 @@ include(HandleLibcxxFlags) | |
# 'config-ix' use them during feature checks. It also adds them to both | ||
# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS' | ||
add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32") | ||
add_target_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}") | ||
add_target_flags_if(LIBCXX_TARGET_TRIPLE "--target=${LIBCXX_TARGET_TRIPLE}") | ||
add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}") | ||
add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}") | ||
add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}") | ||
if (LIBCXX_TARGET_TRIPLE) | ||
set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}") | ||
endif() | ||
|
@@ -414,9 +429,9 @@ remove_flags(-stdlib=libc++ -stdlib=libstdc++) | |
# non-debug DLLs | ||
remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md") | ||
|
||
# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEqDANTIC. | ||
# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC. | ||
# Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors | ||
# so they don't get transformed into -Wno and -errors respectivly. | ||
# so they don't get transformed into -Wno and -errors respectively. | ||
remove_flags(-Wno-pedantic -pedantic-errors -pedantic) | ||
|
||
# Required flags ============================================================== | ||
|
@@ -445,6 +460,11 @@ add_compile_flags_if_supported(-nostdinc++) | |
# the dylib when get ODR used by another function. | ||
add_compile_flags_if_supported(-fvisibility-inlines-hidden) | ||
|
||
if (LIBCXX_CONFIGURE_IDE) | ||
# This simply allows IDE to process <experimental/coroutine> | ||
add_compile_flags_if_supported(-fcoroutines-ts) | ||
endif() | ||
|
||
# Let the library headers know they are currently being used to build the | ||
# library. | ||
add_definitions(-D_LIBCPP_BUILDING_LIBRARY) | ||
|
@@ -466,7 +486,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") | |
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") | ||
add_compile_flags_if_supported( | ||
-Wno-literal-suffix | ||
-Wno-c++14-compat) | ||
-Wno-c++14-compat | ||
-Wno-noexcept-type) | ||
endif() | ||
if (LIBCXX_ENABLE_WERROR) | ||
add_compile_flags_if_supported(-Werror) | ||
|
@@ -623,7 +644,12 @@ endif() | |
# Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or | ||
# LLVM_FOUND is OFF. This allows users to run the tests manually using | ||
# LIT without requiring a full LLVM checkout. | ||
add_subdirectory(test) | ||
# | ||
# However, since some submission systems strip test/ subdirectories, check for | ||
# it before adding it. | ||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") | ||
add_subdirectory(test) | ||
endif() | ||
if (LIBCXX_INCLUDE_TESTS) | ||
add_subdirectory(lib/abi) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@echo on | ||
|
||
if NOT EXIST C:\projects\deps ( | ||
mkdir C:\projects\deps | ||
) | ||
cd C:\projects\deps | ||
|
||
::########################################################################### | ||
:: Setup Compiler | ||
::########################################################################### | ||
if NOT EXIST llvm-installer.exe ( | ||
appveyor DownloadFile http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r303050-win32.exe -FileName llvm-installer.exe | ||
) | ||
if "%CLANG_VERSION%"=="ToT" ( | ||
START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM" | ||
) | ||
if DEFINED CLANG_VERSION @set PATH="C:\Program Files\LLVM\bin";%PATH% | ||
if DEFINED CLANG_VERSION clang-cl -v | ||
|
||
if DEFINED MINGW_PATH rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe" | ||
if DEFINED MINGW_PATH @set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%" | ||
if DEFINED MINGW_PATH @set "PATH=%PATH%;%MINGW_PATH%" | ||
if DEFINED MINGW_PATH g++ -v | ||
|
||
::########################################################################### | ||
:: Install a recent CMake | ||
::########################################################################### | ||
if NOT EXIST cmake ( | ||
appveyor DownloadFile https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip -FileName cmake.zip | ||
7z x cmake.zip -oC:\projects\deps > nul | ||
move C:\projects\deps\cmake-* C:\projects\deps\cmake | ||
rm cmake.zip | ||
) | ||
@set PATH=C:\projects\deps\cmake\bin;%PATH% | ||
cmake --version | ||
|
||
::########################################################################### | ||
:: Install Ninja | ||
::########################################################################### | ||
if NOT EXIST ninja ( | ||
appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip | ||
7z x ninja.zip -oC:\projects\deps\ninja > nul | ||
rm ninja.zip | ||
) | ||
@set PATH=C:\projects\deps\ninja;%PATH% | ||
ninja --version | ||
|
||
::########################################################################### | ||
:: Setup the cached copy of LLVM | ||
::########################################################################### | ||
git clone --depth=1 http://llvm.org/git/llvm.git | ||
|
||
@echo off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
version: '{build}' | ||
|
||
shallow_clone: true | ||
|
||
build: | ||
verbosity: detailed | ||
|
||
configuration: | ||
- Debug | ||
|
||
environment: | ||
matrix: | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | ||
CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe | ||
CLANG_VERSION: ToT | ||
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat | ||
MSVC_SETUP_ARG: x86 | ||
GENERATOR: Ninja | ||
MAKE_PROGRAM: ninja | ||
APPVEYOR_SAVE_CACHE_ON_ERROR: true | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe | ||
CLANG_VERSION: 4 | ||
MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat | ||
MSVC_SETUP_ARG: x86_amd64 | ||
GENERATOR: Ninja | ||
MAKE_PROGRAM: ninja | ||
APPVEYOR_SAVE_CACHE_ON_ERROR: true | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
MINGW_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin | ||
GENERATOR: MinGW Makefiles | ||
MAKE_PROGRAM: mingw32-make | ||
APPVEYOR_SAVE_CACHE_ON_ERROR: true | ||
|
||
install: | ||
############################################################################ | ||
# All external dependencies are installed in C:\projects\deps | ||
############################################################################ | ||
- call "%APPVEYOR_BUILD_FOLDER%\\appveyor-reqs-install.cmd" | ||
|
||
before_build: | ||
- if DEFINED MSVC_SETUP_PATH call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG% | ||
- cd %APPVEYOR_BUILD_FOLDER% | ||
|
||
build_script: | ||
- md C:\projects\build-libcxx | ||
- cd C:\projects\build-libcxx | ||
- echo %configuration% | ||
|
||
############################################################################# | ||
# Configuration Step | ||
############################################################################# | ||
- cmake -G "%GENERATOR%" %CMAKE_OPTIONS% | ||
"-DCMAKE_BUILD_TYPE=%configuration%" | ||
"-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF | ||
-DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported" | ||
%APPVEYOR_BUILD_FOLDER% | ||
|
||
############################################################################# | ||
# Build Step | ||
############################################################################# | ||
- "%MAKE_PROGRAM%" | ||
|
||
test_script: | ||
- "%MAKE_PROGRAM% check-cxx" | ||
|
||
on_failure: | ||
- appveyor PushArtifact CMakeFiles/CMakeOutput.log | ||
- appveyor PushArtifact CMakeFiles/CMakeError.log | ||
|
||
artifacts: | ||
- path: '_build/CMakeFiles/*.log' | ||
name: logs | ||
|
||
cache: | ||
- C:\projects\deps\ninja | ||
- C:\projects\deps\cmake | ||
- C:\projects\deps\llvm-installer.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "benchmark/benchmark_api.h" | ||
|
||
#include <sstream> | ||
double __attribute__((noinline)) istream_numbers(); | ||
|
||
double istream_numbers() { | ||
const char *a[] = { | ||
"-6 69 -71 2.4882e-02 -100 101 -2.00005 5000000 -50000000", | ||
"-25 71 7 -9.3262e+01 -100 101 -2.00005 5000000 -50000000", | ||
"-14 53 46 -6.7026e-02 -100 101 -2.00005 5000000 -50000000" | ||
}; | ||
|
||
int a1, a2, a3, a4, a5, a6, a7; | ||
double f1 = 0.0, f2 = 0.0, q = 0.0; | ||
for (int i=0; i < 3; i++) { | ||
std::istringstream s(a[i]); | ||
s >> a1 | ||
>> a2 | ||
>> a3 | ||
>> f1 | ||
>> a4 | ||
>> a5 | ||
>> f2 | ||
>> a6 | ||
>> a7; | ||
q += (a1 + a2 + a3 + a4 + a5 + a6 + a7 + f1 + f2)/1000000; | ||
} | ||
return q; | ||
} | ||
|
||
static void BM_Istream_numbers(benchmark::State &state) { | ||
double i = 0; | ||
while (state.KeepRunning()) | ||
benchmark::DoNotOptimize(i += istream_numbers()); | ||
} | ||
|
||
BENCHMARK(BM_Istream_numbers)->RangeMultiplier(2)->Range(1024, 4096); | ||
BENCHMARK_MAIN() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.