gcc/testsuite/gcc.dg/asan/use-after-scope-switch-1.c
raw| 1 | // { dg-do run } |
| 2 | // { dg-additional-options "-fdump-tree-gimple" } |
| 3 | |
| 4 | int |
| 5 | main (int argc, char **argv) |
| 6 | { |
| 7 | int *ptr = 0; |
| 8 | |
| 9 | for (unsigned i = 0; i < 2; i++) |
| 10 | { |
| 11 | switch (argc) |
| 12 | { |
| 13 | int a; |
| 14 | default: |
| 15 | ptr = &a; |
| 16 | *ptr = 12345; |
| 17 | break; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | /* { dg-final { scan-tree-dump-times "ASAN_MARK \\(UNPOISON, &a, \[0-9\]\\);" 2 "gimple" } } */ |
| 25 | /* { dg-final { scan-tree-dump-times "ASAN_MARK \\(POISON, &a, \[0-9\]\\);" 1 "gimple" } } */ |