Debian Codegraph @

gcc/testsuite/gdc.dg/asan/attr_no_sanitize1.d

raw
1 // { dg-options "-fsanitize=address -O3 -fdump-tree-optimized" }
2 // { dg-do compile }
3
4 import gcc.attributes;
5
6 @no_sanitize("address")
7 __gshared int globalvar1; // { dg-warning "attribute ignored" }
8
9 pragma(inline, true)
10 @no_sanitize("address")
11 void test_no_address()
12 {
13 counter++;
14 }
15
16 pragma(inline, true)
17 void test_sanitize()()
18 {
19 counter++;
20 }
21
22 void func1()
23 {
24 counter++;
25 test_no_address();
26 test_sanitize();
27 }
28
29 private int counter;
30
31 // { dg-final { scan-tree-dump-times "Function test_no_address" 1 "optimized" } }
32 // { dg-final { scan-tree-dump-times "Function test_sanitize" 0 "optimized" } }