[ASan][Darwin] Adapt test for macOS 11+ version scheme

This test depends on the versioning scheme of OSX.
This commit is contained in:
Julian Lettner 2020-08-05 10:11:50 -07:00
parent e9761688e4
commit 1e90bd7f84
1 changed files with 6 additions and 3 deletions

View File

@ -13,17 +13,20 @@
// RUN: %run %t/a.out 2>&1 \
// RUN: | FileCheck %s
// RUN: IS_OSX_10_11_OR_HIGHER=$([ `sw_vers -productVersion | cut -d'.' -f2` -lt 11 ]; echo $?)
// RUN: MACOS_MAJOR=$(sw_vers -productVersion | cut -d'.' -f1)
// RUN: MACOS_MINOR=$(sw_vers -productVersion | cut -d'.' -f2)
// RUN: IS_MACOS_10_11_OR_HIGHER=$([ $MACOS_MAJOR -eq 10 ] && [ $MACOS_MINOR -lt 11 ]; echo $?)
// On OS X 10.10 and lower, if the dylib is not DYLD-inserted, ASan will re-exec.
// RUN: if [ $IS_OSX_10_11_OR_HIGHER == 0 ]; then \
// RUN: if [ $IS_MACOS_10_11_OR_HIGHER == 0 ]; then \
// RUN: %env_asan_opts=verbosity=1 %run %t/a.out 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOINSERT %s; \
// RUN: fi
// On OS X 10.11 and higher, we don't need to DYLD-insert anymore, and the interceptors
// still installed correctly. Let's just check that things work and we don't try to re-exec.
// RUN: if [ $IS_OSX_10_11_OR_HIGHER == 1 ]; then \
// RUN: if [ $IS_MACOS_10_11_OR_HIGHER == 1 ]; then \
// RUN: %env_asan_opts=verbosity=1 %run %t/a.out 2>&1 \
// RUN: | FileCheck %s; \
// RUN: fi