Skip to content

Commit

Permalink
add HWASAN CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Jan 28, 2024
1 parent 97cbab3 commit 46c8061
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 115 deletions.
41 changes: 41 additions & 0 deletions .ci/azure-pipelines-aarch64-hwasan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- development

pr:
autoCancel: true
branches:
include:
- development

jobs:
- job: BuildAndTest
timeoutInMinutes: 180 # how long to run the job before automatically cancelling
pool: oracle-cloud
steps:
- task: CMake@1
displayName: 'Configure CMake'
inputs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=Release -DENABLE_HWASAN=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DAMReX_SPACEDIM=1'

- task: CMake@1
displayName: 'Build Quokka'
inputs:
cmakeArgs: '--build .'

- task: CMake@1
displayName: 'Run CTest'
inputs:
cmakeArgs: '-E chdir . ctest -j 2 -T Test --output-on-failure'

- task: PublishTestResults@2
inputs:
testResultsFormat: cTest
testResultsFiles: build/Testing/*/Test.xml
testRunTitle: $(Agent.JobName)
condition: succeededOrFailed()
displayName: Publish test results
40 changes: 0 additions & 40 deletions .ci/azure-pipelines-asan.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .ci/azure-pipelines-build-llvm.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .ci/azure-pipelines-debug.yml

This file was deleted.

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(AMReX_TINY_PROFILE ON CACHE BOOL "" FORCE)
option(QUOKKA_PYTHON "Compile with Python support (on/off)" ON)
option(DISABLE_FMAD "Disable fused multiply-add instructions on GPU (on/off)" ON)
option(ENABLE_ASAN "Enable AddressSanitizer and UndefinedBehaviorSanitizer" OFF)
option(ENABLE_HWASAN "Enable HWAddressSanitizer" OFF)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
option(QUOKKA_OPENPMD "Enable OpenPMD output (on/off)" OFF)

Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ if(ENABLE_ASAN)
add_link_options(-fsanitize=address -fsanitize=undefined)
endif(ENABLE_ASAN)

if(ENABLE_HWASAN)
# enable HWAddressSanitizer for debugging
message(STATUS "Compiling with HWAddressSanitizer *enabled*")
add_compile_options(-fsanitize=hwaddress)
add_link_options(-fsanitize=hwaddress)
endif(ENABLE_ASAN)

if(DISABLE_FMAD)
message(STATUS "Fused multiply-add (FMAD) is disabled for device code.")
add_compile_options($<$<COMPILE_LANGUAGE:C>:-ffp-contract=off>)
Expand Down

0 comments on commit 46c8061

Please sign in to comment.