Skip to content

Commit 5208ec5

Browse files
committed
[libc++] Update Google benchmark to v 1.5.5
1 parent 2377eca commit 5208ec5

File tree

123 files changed

+7541
-2174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+7541
-2174
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
Language: Cpp
33
BasedOnStyle: Google
4+
PointerAlignment: Left
45
...
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Checkout LLVM sources
4+
git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
5+
6+
# Setup libc++ options
7+
if [ -z "$BUILD_32_BITS" ]; then
8+
export BUILD_32_BITS=OFF && echo disabling 32 bit build
9+
fi
10+
11+
# Build and install libc++ (Use unstable ABI for better sanitizer coverage)
12+
cd ./llvm-project
13+
cmake -DCMAKE_C_COMPILER=${C_COMPILER} \
14+
-DCMAKE_CXX_COMPILER=${COMPILER} \
15+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
16+
-DCMAKE_INSTALL_PREFIX=/usr \
17+
-DLIBCXX_ABI_UNSTABLE=OFF \
18+
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
19+
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
20+
-DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi' \
21+
-S llvm -B llvm-build -G "Unix Makefiles"
22+
make -C llvm-build -j3 cxx cxxabi
23+
sudo make -C llvm-build install-cxx install-cxxabi
24+
cd ..
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**System**
14+
Which OS, compiler, and compiler version are you using:
15+
- OS:
16+
- Compiler and version:
17+
18+
**To reproduce**
19+
Steps to reproduce the behavior:
20+
1. sync to commit ...
21+
2. cmake/bazel...
22+
3. make ...
23+
4. See error
24+
25+
**Expected behavior**
26+
A clear and concise description of what you expected to happen.
27+
28+
**Screenshots**
29+
If applicable, add screenshots to help explain your problem.
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FR]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: bazel
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
14+
- name: mount bazel cache
15+
uses: actions/[email protected]
16+
env:
17+
cache-name: bazel-cache
18+
with:
19+
path: "~/.cache/bazel"
20+
key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.ref }}
21+
restore-keys: |
22+
${{ env.cache-name }}-${{ runner.os }}-main
23+
24+
- name: build
25+
run: |
26+
bazel build //:benchmark //:benchmark_main //test/...
27+
28+
- name: test
29+
run: |
30+
bazel test --test_output=all //test/...
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: build-and-test-perfcounters
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
job:
11+
# TODO(dominic): Extend this to include compiler and set through env: CC/CXX.
12+
name: ${{ matrix.os }}.${{ matrix.build_type }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04]
18+
build_type: ['Release', 'Debug']
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: install libpfm
23+
run: sudo apt install libpfm4-dev
24+
25+
- name: create build environment
26+
run: cmake -E make_directory ${{ runner.workspace }}/_build
27+
28+
- name: configure cmake
29+
shell: bash
30+
working-directory: ${{ runner.workspace }}/_build
31+
run: cmake -DBENCHMARK_ENABLE_LIBPFM=1 -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
32+
33+
- name: build
34+
shell: bash
35+
working-directory: ${{ runner.workspace }}/_build
36+
run: cmake --build . --config ${{ matrix.build_type }}
37+
38+
# Skip testing, for now. It seems perf_event_open does not succeed on the
39+
# hosting machine, very likely a permissions issue.
40+
# TODO(mtrofin): Enable test.
41+
# - name: test
42+
# shell: bash
43+
# working-directory: ${{ runner.workspace }}/_build
44+
# run: sudo ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: build-and-test
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
7+
jobs:
8+
# TODO: add 32-bit builds (g++ and clang++) for ubuntu
9+
# (requires g++-multilib and libc6:i386)
10+
# TODO: add coverage build (requires lcov)
11+
# TODO: add clang + libc++ builds for ubuntu
12+
# TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
13+
job:
14+
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
20+
build_type: ['Release', 'Debug']
21+
compiler: [g++, clang++]
22+
include:
23+
- displayTargetName: windows-latest-release
24+
os: windows-latest
25+
build_type: 'Release'
26+
- displayTargetName: windows-latest-debug
27+
os: windows-latest
28+
build_type: 'Debug'
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: create build environment
33+
run: cmake -E make_directory ${{ runner.workspace }}/_build
34+
35+
- name: configure cmake
36+
env:
37+
CXX: ${{ matrix.compiler }}
38+
shell: bash
39+
working-directory: ${{ runner.workspace }}/_build
40+
run: >
41+
cmake $GITHUB_WORKSPACE
42+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
43+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
44+
45+
- name: build
46+
shell: bash
47+
working-directory: ${{ runner.workspace }}/_build
48+
run: cmake --build . --config ${{ matrix.build_type }}
49+
50+
- name: test
51+
shell: bash
52+
working-directory: ${{ runner.workspace }}/_build
53+
run: ctest -C ${{ matrix.build_type }} -VV
54+
55+
ubuntu-14_04:
56+
name: ubuntu-14.04.${{ matrix.build_type }}.${{ matrix.compiler }}
57+
runs-on: [ubuntu-latest]
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
build_type: ['Release', 'Debug']
62+
compiler: [g++-4.8, clang++-3.6]
63+
include:
64+
- compiler: g++-6
65+
build_type: 'Debug'
66+
run_tests: true
67+
- compiler: g++-6
68+
build_type: 'Release'
69+
run_tests: true
70+
container: ubuntu:14.04
71+
steps:
72+
- uses: actions/checkout@v2
73+
74+
- name: install required bits
75+
run: |
76+
sudo apt update
77+
sudo apt -y install clang-3.6 cmake3 g++-4.8 git
78+
79+
- name: install other bits
80+
if: ${{ matrix.compiler }} == g++-6
81+
run: |
82+
sudo apt -y install software-properties-common
83+
sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test"
84+
sudo apt update
85+
sudo apt -y install g++-6
86+
87+
- name: create build environment
88+
run: cmake -E make_directory $GITHUB_WORKSPACE/_build
89+
90+
- name: configure cmake
91+
env:
92+
CXX: ${{ matrix.compiler }}
93+
shell: bash
94+
working-directory: ${{ github.workspace }}/_build
95+
run: >
96+
cmake $GITHUB_WORKSPACE
97+
-DBENCHMARK_ENABLE_TESTING=${{ matrix.run_tests }}
98+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=${{ matrix.run_tests }}
100+
101+
- name: build
102+
shell: bash
103+
working-directory: ${{ github.workspace }}/_build
104+
run: cmake --build . --config ${{ matrix.build_type }}
105+
106+
- name: test
107+
if: ${{ matrix.run_tests }}
108+
shell: bash
109+
working-directory: ${{ github.workspace }}/_build
110+
run: ctest -C ${{ matrix.build_type }} -VV
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: pylint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
pylint:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python 3.8
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.8
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pylint pylint-exit conan
24+
- name: Run pylint
25+
run: |
26+
pylint `find . -name '*.py'|xargs` || pylint-exit $?
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: sanitizer
2+
3+
on:
4+
push: {}
5+
pull_request: {}
6+
7+
env:
8+
CC: clang
9+
CXX: clang++
10+
EXTRA_CXX_FLAGS: "-stdlib=libc++"
11+
UBSAN_OPTIONS: "print_stacktrace=1"
12+
13+
jobs:
14+
job:
15+
name: ${{ matrix.sanitizer }}.${{ matrix.build_type }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
build_type: ['Debug', 'RelWithDebInfo']
21+
sanitizer: ['asan', 'ubsan', 'tsan']
22+
# TODO: add 'msan' above. currently failing and needs investigation.
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: configure msan env
27+
if: matrix.sanitizer == 'msan'
28+
run: |
29+
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins" >> $GITHUB_ENV
30+
echo "LIBCXX_SANITIZER=MemoryWithOrigins" >> $GITHUB_ENV
31+
32+
- name: configure ubsan env
33+
if: matrix.sanitizer == 'ubsan'
34+
run: |
35+
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all" >> $GITHUB_ENV
36+
echo "LIBCXX_SANITIZER=Undefined" >> $GITHUB_ENV
37+
38+
- name: configure asan env
39+
if: matrix.sanitizer == 'asan'
40+
run: |
41+
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-recover=all" >> $GITHUB_ENV
42+
echo "LIBCXX_SANITIZER=Address" >> $GITHUB_ENV
43+
44+
- name: configure tsan env
45+
if: matrix.sanitizer == 'tsan'
46+
run: |
47+
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all" >> $GITHUB_ENV
48+
echo "LIBCXX_SANITIZER=Thread" >> $GITHUB_ENV
49+
50+
- name: install llvm stuff
51+
run: "${GITHUB_WORKSPACE}/.github/.libcxx-setup.sh"
52+
53+
- name: create build environment
54+
run: cmake -E make_directory ${{ runner.workspace }}/_build
55+
56+
- name: configure cmake
57+
shell: bash
58+
working-directory: ${{ runner.workspace }}/_build
59+
run: >
60+
cmake $GITHUB_WORKSPACE
61+
-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF
62+
-DBENCHMARK_ENABLE_LIBPFM=OFF
63+
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
64+
-DCMAKE_C_COMPILER=${{ env.CC }}
65+
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
66+
-DCMAKE_C_FLAGS="${{ env.EXTRA_FLAGS }}"
67+
-DCMAKE_CXX_FLAGS="${{ env.EXTRA_FLAGS }} ${{ env.EXTRA_CXX_FLAGS }}"
68+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
69+
70+
- name: build
71+
shell: bash
72+
working-directory: ${{ runner.workspace }}/_build
73+
run: cmake --build . --config ${{ matrix.build_type }}
74+
75+
- name: test
76+
shell: bash
77+
working-directory: ${{ runner.workspace }}/_build
78+
run: ctest -C ${{ matrix.build_type }} -VV

0 commit comments

Comments
 (0)