PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / asan / use-after-scope-goto-1.c
blobc1538e4e29b63b34d39877823f475739c38dd69a
1 // { dg-do run }
2 // { dg-additional-options "-fdump-tree-asan0" }
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 int main(int argc, char **argv)
7 int a = 123;
8 int b = 123;
9 int c = 123;
10 int d = 123;
11 int e = 123;
12 int f = 123;
14 if (argc == 0)
16 int *ptr;
17 int *ptr2;
18 int *ptr3;
19 int *ptr4;
20 int *ptr5;
21 int *ptr6;
22 label:
24 ptr = &a;
25 *ptr = 1;
26 ptr2 = &b;
27 *ptr2 = 1;
28 ptr3 = &c;
29 *ptr3 = 1;
30 ptr4 = &d;
31 *ptr4 = 1;
32 ptr5 = &e;
33 *ptr5 = 1;
34 ptr6 = &f;
35 *ptr6 = 1;
36 return 0;
39 else
40 goto label;
42 return 0;
45 /* { dg-final { scan-tree-dump-times "ASAN_MARK \\(UNPOISON, &a, 4\\);" 2 "asan0" } } */
46 /* { dg-final { scan-tree-dump-times "ASAN_MARK \\(UNPOISON, &c, 4\\);" 2 "asan0" } } */
47 /* { dg-final { scan-tree-dump-times "ASAN_MARK \\(UNPOISON, &e, 4\\);" 2 "asan0" } } */