2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / attrib-1.c
bloba2a7f7c9f99174a9fe66f9afab90d27213ab9144
1 /* PR sanitizer/55435 */
2 /* { dg-do compile } */
4 __attribute__((no_sanitize_address)) int
5 f1 (int *p, int *q)
7 *p = 42;
8 return *q;
11 void f2 (char *);
12 void f2 (char *) __attribute__((no_sanitize_address));
13 void f2 (char *) __attribute__((no_sanitize_address));
14 void f2 (char *);
16 void
17 f2 (char *p)
19 *p = 42;
22 void f3 (short *);
23 __typeof (f3) f3 __attribute__((__no_sanitize_address__));
25 void
26 f3 (short *p)
28 *p = 42;
31 __attribute__((no_sanitize_address)) int
32 f4 (int *p, int *q)
34 *p = 42;
35 return *q;
38 void f5 (char *);
39 void f5 (char *) __attribute__((no_sanitize_address));
40 void f5 (char *) __attribute__((no_sanitize_address));
41 void f5 (char *);
43 void
44 f5 (char *p)
46 *p = 42;
49 void f6 (short *);
50 __typeof (f6) f6 __attribute__((__no_address_safety_analysis__));
52 void
53 f6 (short *p)
55 *p = 42;
58 int v __attribute__((no_sanitize_address)); /* { dg-warning "attribute ignored" } */
59 int v2 __attribute__((no_address_safety_analysis)); /* { dg-warning "attribute ignored" } */
61 /* { dg-final { scan-assembler-not "__asan_report_store" } } */
62 /* { dg-final { scan-assembler-not "__asan_report_load" } } */