summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/use-after-scope-loop-bug.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/use-after-scope-loop-bug.cc')
-rw-r--r--test/asan/TestCases/use-after-scope-loop-bug.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/asan/TestCases/use-after-scope-loop-bug.cc b/test/asan/TestCases/use-after-scope-loop-bug.cc
index 6ad9bf3260ccd..d4b12eca9808f 100644
--- a/test/asan/TestCases/use-after-scope-loop-bug.cc
+++ b/test/asan/TestCases/use-after-scope-loop-bug.cc
@@ -1,10 +1,7 @@
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN: not %run %t 2>&1 | FileCheck %s
-//
-// FIXME: @llvm.lifetime.* are not emitted for x.
-// XFAIL: *
-int *p;
+volatile int *p;
int main() {
// Variable goes in and out of scope.
@@ -13,4 +10,8 @@ int main() {
p = x + i;
}
return *p; // BOOM
+ // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-bug.cc:[[@LINE-2]]
+ // CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
+ // {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
}