comparison gcc/testsuite/c-c++-common/asan/pr62089.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-shouldfail "asan" } */
3
4 #include <sanitizer/asan_interface.h>
5
6 struct vfsmount {};
7 struct dentry {};
8
9 struct path {
10 struct vfsmount *mnt;
11 struct dentry *dentry;
12 };
13
14 struct fs_struct {
15 int users;
16 int lock;
17 int seq;
18 int umask;
19 int in_exec;
20 struct path root, pwd;
21 };
22
23 void __attribute__((noinline, noclone))
24 copy_fs_struct(struct fs_struct *a, struct fs_struct *b) {
25 a->root = b->root;
26 }
27
28 struct fs_struct a, b;
29
30 int
31 main () {
32 __asan_poison_memory_region (&a.root, sizeof (a.root));
33 copy_fs_struct (&a, &b);
34 return 0;
35 }
36
37 /* { dg-output "ERROR: AddressSanitizer:\[^\n\r]*on address\[^\n\r]*" } */