From da835e84f2651d0747be3770d874c76cdf5426a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= Date: Thu, 17 Jun 2021 11:14:45 +0200 Subject: [PATCH] Test record and replay of an asan enabled binary, if libasan is available. Related to #2892 --- CMakeLists.txt | 1 + src/test/asan_record_replay.run | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/test/asan_record_replay.run diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cdc1a31321..837c3f0fc25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1344,6 +1344,7 @@ set(TESTS_WITH_PROGRAM # # Alphabetical, please. set(TESTS_WITHOUT_PROGRAM + asan_record_replay async_signal_syscalls_100 async_signal_syscalls_1000 bad_breakpoint diff --git a/src/test/asan_record_replay.run b/src/test/asan_record_replay.run new file mode 100644 index 00000000000..fc0178fef21 --- /dev/null +++ b/src/test/asan_record_replay.run @@ -0,0 +1,17 @@ +source `dirname $0`/util.sh + +cat < asan-test.c +#include +void main() { + printf("EXIT-SUCCESS\n"); +} +EOF + +if [[ "$bitness" == "_32" ]]; then ARCHFLAG=-m32; fi +cc -fsanitize=address $ARCHFLAG -c -o asan-test.o asan-test.c && \ +cc -fsanitize=address $ARCHFLAG -o asan-test asan-test.o +(($? != 0)) && { echo NOTE: Skipping "'$TESTNAME'" because build failed; exit 0; } + +just_record ./asan-test +replay +check EXIT-SUCCESS