Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/asan/attrib-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 /* PR sanitizer/55435 */ | |
2 /* { dg-do compile } */ | |
3 | |
4 __attribute__((no_sanitize_address)) int | |
5 f1 (int *p, int *q) | |
6 { | |
7 *p = 42; | |
8 return *q; | |
9 } | |
10 | |
11 void f2 (char *); | |
12 void f2 (char *) __attribute__((no_sanitize_address)); | |
13 void f2 (char *) __attribute__((no_sanitize_address)); | |
14 void f2 (char *); | |
15 | |
16 void | |
17 f2 (char *p) | |
18 { | |
19 *p = 42; | |
20 } | |
21 | |
22 void f3 (short *); | |
23 __typeof (f3) f3 __attribute__((__no_sanitize_address__)); | |
24 | |
25 void | |
26 f3 (short *p) | |
27 { | |
28 *p = 42; | |
29 } | |
30 | |
31 __attribute__((no_sanitize_address)) int | |
32 f4 (int *p, int *q) | |
33 { | |
34 *p = 42; | |
35 return *q; | |
36 } | |
37 | |
38 void f5 (char *); | |
39 void f5 (char *) __attribute__((no_sanitize_address)); | |
40 void f5 (char *) __attribute__((no_sanitize_address)); | |
41 void f5 (char *); | |
42 | |
43 void | |
44 f5 (char *p) | |
45 { | |
46 *p = 42; | |
47 } | |
48 | |
49 void f6 (short *); | |
50 __typeof (f6) f6 __attribute__((__no_address_safety_analysis__)); | |
51 | |
52 void | |
53 f6 (short *p) | |
54 { | |
55 *p = 42; | |
56 } | |
57 | |
58 int v __attribute__((no_sanitize_address)); /* { dg-warning "attribute ignored" } */ | |
59 int v2 __attribute__((no_address_safety_analysis)); /* { dg-warning "attribute ignored" } */ | |
60 | |
61 /* { dg-final { scan-assembler-not "__asan_report_store" } } */ | |
62 /* { dg-final { scan-assembler-not "__asan_report_load" } } */ |