summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/strip_path_prefix.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/strip_path_prefix.c')
-rw-r--r--test/asan/TestCases/strip_path_prefix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/asan/TestCases/strip_path_prefix.c b/test/asan/TestCases/strip_path_prefix.c
new file mode 100644
index 000000000..c4d6ba49d
--- /dev/null
+++ b/test/asan/TestCases/strip_path_prefix.c
@@ -0,0 +1,12 @@
+// RUN: %clang_asan -O2 %s -o %t
+// RUN: ASAN_OPTIONS="strip_path_prefix='/'" not %t 2>&1 | FileCheck %s
+
+#include <stdlib.h>
+int main() {
+ char *x = (char*)malloc(10 * sizeof(char));
+ free(x);
+ return x[5];
+ // Check that paths in error report don't start with slash.
+ // CHECK: heap-use-after-free
+ // CHECK-NOT: #0 0x{{.*}} ({{[/].*}})
+}