summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/use-after-scope-temp.cc
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2016-07-28 23:03:27 +0000
committerVitaly Buka <vitalybuka@google.com>2016-07-28 23:03:27 +0000
commit41a0641fde7ea343ec26862de0d96b32a85b56a7 (patch)
treebc3bd0bd837109cc01c5e4de39ad25d790ee40cc /test/asan/TestCases/use-after-scope-temp.cc
parent9eac4898b92fc03078739b04b8e0625902105c82 (diff)
[asan] Enable the rest of use-after-scope tests
Summary: Test where broken because of missing lifetime markers for temps and because of aggressive optimization which removed markers in some cases. PR27453 Reviewers: eugenis, kcc Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D22894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan/TestCases/use-after-scope-temp.cc')
-rw-r--r--test/asan/TestCases/use-after-scope-temp.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/asan/TestCases/use-after-scope-temp.cc b/test/asan/TestCases/use-after-scope-temp.cc
index 3736f914d..4dcef59a2 100644
--- a/test/asan/TestCases/use-after-scope-temp.cc
+++ b/test/asan/TestCases/use-after-scope-temp.cc
@@ -1,8 +1,6 @@
-// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
+// RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
-//
-// Lifetime for temporaries is not emitted yet.
-// XFAIL: *
+
struct IntHolder {
int val;
@@ -15,9 +13,9 @@ void save(const IntHolder &holder) {
}
int main(int argc, char *argv[]) {
- save({10});
+ save({argc});
int x = saved->val; // BOOM
-// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
-// CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
+ // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
return x;
}