diff options
Diffstat (limited to 'test/asan/TestCases/zero_page_pc.cc')
-rw-r--r-- | test/asan/TestCases/zero_page_pc.cc | 12 |
1 files changed, 12 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 0000000000000..5810a9fb9dde5 --- /dev/null +++ b/test/asan/TestCases/zero_page_pc.cc @@ -0,0 +1,12 @@ +// 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 *)0x4; + func(); + // x86 reports the SEGV with both address=4 and pc=4. + // PowerPC64 reports it with address=4 but pc still in main(). + // CHECK: {{AddressSanitizer: SEGV.*(address|pc) 0x0*4}} + return 0; +} |