Skip to content

add [[clang::lifetimebound]] annotations where possible #757

add [[clang::lifetimebound]] annotations where possible

add [[clang::lifetimebound]] annotations where possible #757

name: AddressSanitizer
on:
push:
branches: [ main, 'v1.*' ]
pull_request:
branches: [ main ]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build-and-test:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
PRESET: [clang-linux-debug,clang-linux-release]
WORK_ITEM: [CORO,FUNCORO]
steps:
- name: install-hwloc
run: sudo apt-get update && sudo apt-get install -y hwloc libhwloc-dev
- uses: actions/checkout@v4
with:
repository: tzcnt/tmc-examples
ref: main
- name: branch-examples
continue-on-error: true
run: git fetch --tags && git checkout ${{env.BRANCH_NAME}}
- name: submodule-clone
run: >
cd submodules
&& git clone https://github.com/tzcnt/TooManyCooks.git
# If a branch with the same name exists in the dependency repos, use that. Otherwise, use main.
- name: submodule-branch-TMC
# continue-on-error: true # this should never fail if triggered from TMC workflow
run: cd submodules/TooManyCooks && git fetch && git checkout ${{env.BRANCH_NAME}}
- name: configure
run: cmake -G "Unix Makefiles" -DTMC_AS_SUBMODULE=ON -DTMC_COPY_COMPILE_COMMANDS=OFF -DTMC_WORK_ITEM=${{matrix.WORK_ITEM}} -DCMD_COMPILE_FLAGS='-Werror;-fsanitize=address' -DCMD_LINK_FLAGS='-fsanitize=address' --preset ${{matrix.PRESET}} .
- name: build
run: cmake --build ./build/${{matrix.PRESET}} --parallel $(nproc) --target all
- name: run tests
run: ASAN_OPTIONS="detect_leaks=1" ./build/${{matrix.PRESET}}/tests/tests