aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/use-after-scope-nobug.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/use-after-scope-nobug.cc')
-rw-r--r--test/asan/TestCases/use-after-scope-nobug.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/asan/TestCases/use-after-scope-nobug.cc b/test/asan/TestCases/use-after-scope-nobug.cc
index 21b085c96275..cf471dc345fa 100644
--- a/test/asan/TestCases/use-after-scope-nobug.cc
+++ b/test/asan/TestCases/use-after-scope-nobug.cc
@@ -1,14 +1,15 @@
-// RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && %run %t
-// XFAIL: *
+// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && %run %t
#include <stdio.h>
+#include <stdlib.h>
+
+int *p[3];
int main() {
- int *p = 0;
// Variable goes in and out of scope.
for (int i = 0; i < 3; i++) {
- int x = 0;
- p = &x;
+ int x;
+ p[i] = &x;
}
printf("PASSED\n");
return 0;