forked from OSchip/llvm-project
[ASan] turn off checking initialization order in ASan runtime by default. Instead, it should be turned on by default in the compiler
llvm-svn: 177058
This commit is contained in:
parent
fe0199ea54
commit
963be1ddd8
|
@ -141,7 +141,7 @@ void InitializeFlags(Flags *f, const char *env) {
|
|||
f->redzone = ASAN_ALLOCATOR_VERSION == 2 ? 16 : (ASAN_LOW_MEMORY) ? 64 : 128;
|
||||
f->debug = false;
|
||||
f->report_globals = 1;
|
||||
f->check_initialization_order = true;
|
||||
f->check_initialization_order = false;
|
||||
f->malloc_context_size = kDeafultMallocContextSize;
|
||||
f->replace_str = true;
|
||||
f->replace_intrin = true;
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
// independently on order in which we list source files.
|
||||
|
||||
// RUN: %clangxx_asan -m64 -O0 %s %p/../Helpers/initialization-bug-extra.cc\
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1 \
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
|
||||
// RUN: | %symbolize | FileCheck %s
|
||||
// RUN: %clangxx_asan -m64 -O0 %p/../Helpers/initialization-bug-extra.cc %s\
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1 \
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
|
||||
// RUN: | %symbolize | FileCheck %s
|
||||
|
||||
// Do not test with optimization -- the error may be optimized away.
|
||||
|
|
|
@ -2,22 +2,28 @@
|
|||
|
||||
// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
|
||||
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt \
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
|
||||
// Function is defined in another TU.
|
||||
int readBadGlobal();
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// Test to make sure basic initialization order errors are caught.
|
||||
|
||||
// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-bug-extra2.cc\
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1 \
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
|
||||
// RUN: | %symbolize | FileCheck %s
|
||||
// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-bug-extra2.cc\
|
||||
// RUN: -fsanitize=init-order -o %t && %t 2>&1 \
|
||||
// RUN: -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1 \
|
||||
// RUN: | %symbolize | FileCheck %s
|
||||
|
||||
// Do not test with optimization -- the error may be optimized away.
|
||||
|
|
|
@ -2,23 +2,32 @@
|
|||
// order checking. If successful, this will just return 0.
|
||||
|
||||
// RUN: %clangxx_asan -m64 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m64 -O1 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m64 -O2 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m64 -O3 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O0 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O1 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O2 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
// RUN: %clangxx_asan -m32 -O3 %s %p/Helpers/initialization-nobug-extra.cc\
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t && %t 2>&1
|
||||
// RUN: --std=c++11 -fsanitize=init-order -o %t
|
||||
// RUN: ASAN_OPTIONS=check_initialization_order=true %t 2>&1
|
||||
|
||||
// Simple access:
|
||||
// Make sure that accessing a global in the same TU is safe
|
||||
|
|
Loading…
Reference in New Issue