diff --git a/compiler-rt/test/msan/Linux/swapcontext_annotation_reset.cpp b/compiler-rt/test/msan/Linux/swapcontext_annotation_reset.cpp --- a/compiler-rt/test/msan/Linux/swapcontext_annotation_reset.cpp +++ b/compiler-rt/test/msan/Linux/swapcontext_annotation_reset.cpp @@ -1,5 +1,5 @@ -// RUN: %clangxx_msan -fno-sanitize=memory -c %s -o %t-main.o -// RUN: %clangxx_msan %t-main.o %s -o %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fno-sanitize=memory -c %s -o %t-main.o +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval %t-main.o %s -o %t // RUN: %run %t #include diff --git a/compiler-rt/test/msan/bsearch.cpp b/compiler-rt/test/msan/bsearch.cpp --- a/compiler-rt/test/msan/bsearch.cpp +++ b/compiler-rt/test/msan/bsearch.cpp @@ -1,12 +1,12 @@ // __NO_INLINE__ is defined so bsearch needs interceptor. -// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t -// RUN: %clangxx_msan -DPOISON_DATA -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_msan -DPOISON_KEY -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 -g %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -DPOISON_DATA -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -DPOISON_KEY -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s // __NO_INLINE__ is undefined so bsearch should be inlined and instrumented and still work as expected. -// RUN: %clangxx_msan -O2 -g %s -o %t && %run %t -// RUN: %clangxx_msan -DPOISON_DATA -O2 -g %s -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_msan -DPOISON_KEY -O2 -g %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O2 -g %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -DPOISON_DATA -O2 -g %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -DPOISON_KEY -O2 -g %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/msan/chained_origin.cpp b/compiler-rt/test/msan/chained_origin.cpp --- a/compiler-rt/test/msan/chained_origin.cpp +++ b/compiler-rt/test/msan/chained_origin.cpp @@ -19,20 +19,11 @@ volatile int x, y; -__attribute__((noinline)) -void fn_g(int a) { - x = a; -} +__attribute__((noinline)) void fn_g(int &a) { x = a; } -__attribute__((noinline)) -void fn_f(int a) { - fn_g(a); -} +__attribute__((noinline)) void fn_f(int &a) { fn_g(a); } -__attribute__((noinline)) -void fn_h() { - y = x; -} +__attribute__((noinline)) void fn_h() { y = x; } int main(int argc, char *argv[]) { #ifdef HEAP @@ -41,7 +32,7 @@ #else int volatile z; #endif - fn_f(z); + fn_f((int &)z); fn_h(); return y; } @@ -50,13 +41,13 @@ // CHECK: {{#0 .* in main.*chained_origin.cpp:}}[[@LINE-4]] // CHECK: Uninitialized value was stored to memory at -// CHECK-FULL-STACK: {{#0 .* in fn_h.*chained_origin.cpp:}}[[@LINE-19]] +// CHECK-FULL-STACK: {{#0 .* in fn_h.*chained_origin.cpp:}}[[@LINE-18]] // CHECK-FULL-STACK: {{#1 .* in main.*chained_origin.cpp:}}[[@LINE-9]] // CHECK-SHORT-STACK: {{#0 .* in fn_h.*chained_origin.cpp:}}[[@LINE-21]] // CHECK: Uninitialized value was stored to memory at -// CHECK-FULL-STACK: {{#0 .* in fn_g.*chained_origin.cpp:}}[[@LINE-34]] -// CHECK-FULL-STACK: {{#1 .* in fn_f.*chained_origin.cpp:}}[[@LINE-30]] +// CHECK-FULL-STACK: {{#0 .* in fn_g.*chained_origin.cpp:}}[[@LINE-27]] +// CHECK-FULL-STACK: {{#1 .* in fn_f.*chained_origin.cpp:}}[[@LINE-26]] // CHECK-FULL-STACK: {{#2 .* in main.*chained_origin.cpp:}}[[@LINE-16]] // CHECK-SHORT-STACK: {{#0 .* in fn_g.*chained_origin.cpp:}}[[@LINE-37]] diff --git a/compiler-rt/test/msan/chained_origin_empty_stack.cpp b/compiler-rt/test/msan/chained_origin_empty_stack.cpp --- a/compiler-rt/test/msan/chained_origin_empty_stack.cpp +++ b/compiler-rt/test/msan/chained_origin_empty_stack.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -O3 %s -o %t && \ // RUN: MSAN_OPTIONS=store_context_size=1 not %run %t 2>&1 | FileCheck %s // Test that stack trace for the intermediate store is not empty. diff --git a/compiler-rt/test/msan/chained_origin_memcpy.cpp b/compiler-rt/test/msan/chained_origin_memcpy.cpp --- a/compiler-rt/test/msan/chained_origin_memcpy.cpp +++ b/compiler-rt/test/msan/chained_origin_memcpy.cpp @@ -1,17 +1,16 @@ -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%short-stack < %t.out -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%short-stack < %t.out - -// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%short-stack < %t.out -// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%short-stack < %t.out diff --git a/compiler-rt/test/msan/chained_origin_memmove.cpp b/compiler-rt/test/msan/chained_origin_memmove.cpp --- a/compiler-rt/test/msan/chained_origin_memmove.cpp +++ b/compiler-rt/test/msan/chained_origin_memmove.cpp @@ -1,16 +1,16 @@ -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%short-stack < %t.out -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%short-stack < %t.out -// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=0 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z1 --check-prefix=CHECK-%short-stack < %t.out -// RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -DOFFSET=10 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-Z2 --check-prefix=CHECK-%short-stack < %t.out diff --git a/compiler-rt/test/msan/cxa_atexit.cpp b/compiler-rt/test/msan/cxa_atexit.cpp --- a/compiler-rt/test/msan/cxa_atexit.cpp +++ b/compiler-rt/test/msan/cxa_atexit.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 %s -o %t && %run %t %p // PR17377: C++ module destructors get stale argument shadow. diff --git a/compiler-rt/test/msan/insertvalue_origin.cpp b/compiler-rt/test/msan/insertvalue_origin.cpp --- a/compiler-rt/test/msan/insertvalue_origin.cpp +++ b/compiler-rt/test/msan/insertvalue_origin.cpp @@ -13,7 +13,7 @@ int y; }; -mypair my_make_pair(int64_t x, int y) { +mypair my_make_pair(int64_t &x, int y) { mypair p; p.x = x; p.y = y; diff --git a/compiler-rt/test/msan/no_sanitize_memory_prop.cpp b/compiler-rt/test/msan/no_sanitize_memory_prop.cpp --- a/compiler-rt/test/msan/no_sanitize_memory_prop.cpp +++ b/compiler-rt/test/msan/no_sanitize_memory_prop.cpp @@ -1,7 +1,7 @@ -// RUN: %clangxx_msan -O0 %s -o %t && %run %t >%t.out 2>&1 -// RUN: %clangxx_msan -O1 %s -o %t && %run %t >%t.out 2>&1 -// RUN: %clangxx_msan -O2 %s -o %t && %run %t >%t.out 2>&1 -// RUN: %clangxx_msan -O3 %s -o %t && %run %t >%t.out 2>&1 +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 %s -o %t && %run %t >%t.out 2>&1 +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O1 %s -o %t && %run %t >%t.out 2>&1 +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O2 %s -o %t && %run %t >%t.out 2>&1 +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O3 %s -o %t && %run %t >%t.out 2>&1 // Test that (no_sanitize_memory) functions DO NOT propagate shadow. diff --git a/compiler-rt/test/msan/noundef_analysis.cpp b/compiler-rt/test/msan/noundef_analysis.cpp --- a/compiler-rt/test/msan/noundef_analysis.cpp +++ b/compiler-rt/test/msan/noundef_analysis.cpp @@ -1,8 +1,6 @@ -// RUN: %clangxx_msan %s -o %t && %run %t >%t.out 2>&1 +// RUN: %clangxx_msan %s -fno-sanitize-memory-param-retval -o %t && %run %t >%t.out 2>&1 // RUN: FileCheck %s --check-prefix=MISSED --allow-empty < %t.out -// RUN: %clangxx_msan %s -mllvm -msan-eager-checks=1 -o %t && not %run %t >%t.out 2>&1 -// RUN: FileCheck %s < %t.out -// RUN: %clangxx_msan %s -disable-noundef-analysis -fsanitize-memory-param-retval -o %t && not %run %t >%t.out 2>&1 +// RUN: %clangxx_msan %s -mllvm -msan-eager-checks=1 -fno-sanitize-memory-param-retval -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out struct SimpleStruct { diff --git a/compiler-rt/test/msan/param_tls_limit.cpp b/compiler-rt/test/msan/param_tls_limit.cpp --- a/compiler-rt/test/msan/param_tls_limit.cpp +++ b/compiler-rt/test/msan/param_tls_limit.cpp @@ -1,9 +1,9 @@ // ParamTLS has limited size. Everything that does not fit is considered fully // initialized. -// RUN: %clangxx_msan -O0 %s -o %t && %run %t -// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && %run %t -// RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O0 %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins -O0 %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -O0 %s -o %t && %run %t // // AArch64 fails with: // void f801(S<801>): Assertion `__msan_test_shadow(&s, sizeof(s)) == -1' failed diff --git a/compiler-rt/test/msan/qsort.cpp b/compiler-rt/test/msan/qsort.cpp --- a/compiler-rt/test/msan/qsort.cpp +++ b/compiler-rt/test/msan/qsort.cpp @@ -1,5 +1,5 @@ -// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t -// RUN: %clangxx_msan -DPOISON -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -O0 -g %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -DPOISON -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/msan/signal_stress_test.cpp b/compiler-rt/test/msan/signal_stress_test.cpp --- a/compiler-rt/test/msan/signal_stress_test.cpp +++ b/compiler-rt/test/msan/signal_stress_test.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval -std=c++11 -O0 %s -o %t && %run %t // // Test that va_arg shadow from a signal handler does not leak outside. diff --git a/compiler-rt/test/msan/unpoison_param.cpp b/compiler-rt/test/msan/unpoison_param.cpp --- a/compiler-rt/test/msan/unpoison_param.cpp +++ b/compiler-rt/test/msan/unpoison_param.cpp @@ -3,7 +3,7 @@ // compile main() without MSan. // RUN: %clangxx_msan -fno-sanitize=memory -c %s -o %t-main.o -// RUN: %clangxx_msan %t-main.o %s -o %t +// RUN: %clangxx_msan -fno-sanitize-memory-param-retval %t-main.o %s -o %t // RUN: %run %t #include diff --git a/compiler-rt/test/msan/vector_cvt.cpp b/compiler-rt/test/msan/vector_cvt.cpp --- a/compiler-rt/test/msan/vector_cvt.cpp +++ b/compiler-rt/test/msan/vector_cvt.cpp @@ -4,7 +4,7 @@ #include -int to_int(double v) { +int to_int(double &v) { __m128d t = _mm_set_sd(v); int x = _mm_cvtsd_si32(t); return x;