[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / pr81281-2.c
blobba2c648167d7ad774d3ae8ba9427fb2a06699b0b
1 /* PR sanitizer/81281 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-not "p_\[0-9]*\\(D\\)" "optimized" } } */
6 typedef __SIZE_TYPE__ size_t;
7 typedef __INTPTR_TYPE__ T;
10 f1 (char *p, size_t a, size_t b)
12 char *c = p + 1;
13 size_t d = a + 2;
14 size_t e = b + 3;
15 T f = (T) (p + a);
16 T g = (T) (p + b);
17 return f - g;
21 f2 (char *p, size_t a, size_t b)
23 size_t c = a + 1;
24 char *d = p + 2;
25 size_t e = b + 3;
26 T f = (T) (p + a);
27 T g = (T) (p + b);
28 return f - g;
32 f3 (char *p, size_t a, size_t b)
34 size_t c = b + 1;
35 char *d = p + 2;
36 size_t e = a + 3;
37 T f = (T) (p + a);
38 T g = (T) (p + b);
39 return f - g;
43 f4 (char *p, size_t a)
45 char *c = p + 1;
46 size_t d = a + 2;
47 T f = (T) (p + a);
48 T g = (T) p;
49 return f - g;
53 f5 (char *p, size_t a)
55 size_t c = a + 1;
56 char *d = p + 2;
57 T f = (T) (p + a);
58 T g = (T) p;
59 return f - g;
63 f6 (char *p, size_t a)
65 char *c = p + 1;
66 size_t d = a + 2;
67 T f = (T) p;
68 T g = (T) (p + a);
69 return f - g;
73 f7 (char *p, size_t a)
75 size_t c = a + 1;
76 char *d = p + 2;
77 T f = (T) p;
78 T g = (T) (p + a);
79 return f - g;