summaryrefslogtreecommitdiff
path: root/test/msan/chained_origin_limits.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-09-03 12:15:59 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-09-03 12:15:59 +0000
commit7253ec68cf561fd3e1e61a6c9857759bb85fa51a (patch)
tree0f5db3f46e42d44cc1ef78a7ed7443dc6347bd09 /test/msan/chained_origin_limits.cc
parent590928cf13ee02ce57feea4b83a6c91b27ff390c (diff)
[msan] Fix origin_history_per_stack_limit=0 behavior.
It disables the per-stack limit. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/msan/chained_origin_limits.cc')
-rw-r--r--test/msan/chained_origin_limits.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/msan/chained_origin_limits.cc b/test/msan/chained_origin_limits.cc
index a8621f3ae..466d121cd 100644
--- a/test/msan/chained_origin_limits.cc
+++ b/test/msan/chained_origin_limits.cc
@@ -12,6 +12,9 @@
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out
+// RUN: MSAN_OPTIONS=origin_history_size=0,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK-UNLIMITED < %t.out
+
// Stack origin.
// RUN: %clangxx_msan -DSTACK -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t
@@ -24,6 +27,9 @@
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out
+// RUN: MSAN_OPTIONS=origin_history_size=0,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK-UNLIMITED < %t.out
+
// Heap origin, with calls.
// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t
@@ -37,6 +43,9 @@
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out
+// RUN: MSAN_OPTIONS=origin_history_size=0,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK-UNLIMITED < %t.out
+
// Stack origin, with calls.
// RUN: %clangxx_msan -DSTACK -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t
@@ -50,6 +59,9 @@
// RUN: MSAN_OPTIONS=origin_history_per_stack_limit=1 not %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=CHECK-PER-STACK < %t.out
+// RUN: MSAN_OPTIONS=origin_history_size=0,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
+// RUN: FileCheck %s --check-prefix=CHECK-UNLIMITED < %t.out
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -143,3 +155,24 @@ int main(void) {
// CHECK-PER-STACK: Uninitialized value was stored to memory at
// CHECK-PER-STACK: in fn1
// CHECK-PER-STACK: Uninitialized value was created
+
+// CHECK-UNLIMITED: WARNING: MemorySanitizer: use-of-uninitialized-value
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was stored to memory at
+// CHECK-UNLIMITED: Uninitialized value was created