summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/zero_page_pc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/zero_page_pc.cc')
-rw-r--r--test/asan/TestCases/zero_page_pc.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/asan/TestCases/zero_page_pc.cc b/test/asan/TestCases/zero_page_pc.cc
new file mode 100644
index 000000000..87be154d6
--- /dev/null
+++ b/test/asan/TestCases/zero_page_pc.cc
@@ -0,0 +1,11 @@
+// Check that ASan correctly detects SEGV on the zero page.
+// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
+
+typedef void void_f();
+int main() {
+ void_f *func = (void_f *)0x7;
+ func();
+ // CHECK: {{AddressSanitizer: SEGV.*(pc.*0007)}}
+ // CHECK: AddressSanitizer: while reporting a bug found another one. Ignoring.
+ return 0;
+}