diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp --- a/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp +++ b/compiler-rt/test/asan/TestCases/use-after-scope-dtor-order.cpp @@ -1,11 +1,14 @@ // RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s \ +// RUN: -fexperimental-new-pass-manager -o %t && \ +// RUN: not %run %t 2>&1 | FileCheck %s #include struct IntHolder { explicit IntHolder(int *val = 0) : val_(val) { } - ~IntHolder() { + __attribute__((noinline)) ~IntHolder() { printf("Value: %d\n", *val_); // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}.cpp:[[@LINE-2]] diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp --- a/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp +++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp.cpp @@ -1,6 +1,8 @@ // RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s - +// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s \ +// RUN: -fexperimental-new-pass-manager -o %t && \ +// RUN: not %run %t 2>&1 | FileCheck %s struct IntHolder { int val; @@ -8,7 +10,7 @@ const IntHolder *saved; -void save(const IntHolder &holder) { +__attribute__((noinline)) void save(const IntHolder &holder) { saved = &holder; } diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp --- a/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp +++ b/compiler-rt/test/asan/TestCases/use-after-scope-temp2.cpp @@ -1,9 +1,11 @@ // RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s - +// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s \ +// RUN: -fexperimental-new-pass-manager -o %t && \ +// RUN: not %run %t 2>&1 | FileCheck %s struct IntHolder { - const IntHolder& Self() const { + __attribute__((noinline)) const IntHolder &Self() const { return *this; } int val = 3;