Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/asan/null-deref-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do run } */ | |
2 /* { dg-options "-fno-omit-frame-pointer -fno-shrink-wrap" } */ | |
3 /* { dg-additional-options "-mno-omit-leaf-frame-pointer" { target { i?86-*-* x86_64-*-* } } } */ | |
4 /* { dg-shouldfail "asan" } */ | |
5 | |
6 __attribute__((noinline, noclone)) | |
7 static void | |
8 NullDeref(int *ptr) | |
9 { | |
10 ptr[10]++; | |
11 } | |
12 | |
13 int main() | |
14 { | |
15 NullDeref((int*)0); | |
16 return 0; | |
17 } | |
18 | |
19 /* { dg-output "ERROR: AddressSanitizer:? SEGV on unknown address\[^\n\r]*" } */ | |
20 /* { dg-output "0x\[0-9a-f\]+ \[^\n\r]*pc 0x\[0-9a-f\]+.*(\n|\r\n|\r)" } */ | |
21 /* { dg-output " #0 0x\[0-9a-f\]+ +(in \[^\n\r]*NullDeref\[^\n\r]* (\[^\n\r]*null-deref-1.c:10|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */ | |
22 /* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*null-deref-1.c:15|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */ |