PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / stack-check-8.c
blob84d5adef15446dccebb0149542e004e349e42ef5
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fstack-clash-protection -Wno-psabi -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
3 /* { dg-require-effective-target supports_stack_clash_protection } */
6 typedef float V __attribute__((vector_size (32)));
8 __attribute__((noinline, noclone)) void
9 foo (char *p)
11 asm volatile ("" : : "r" (p) : "memory");
14 __attribute__((noinline, noclone)) int
15 f0 (int x, int y)
17 asm volatile ("" : : : "memory");
18 return x + y;
21 __attribute__((noinline, noclone)) void
22 f1 (void)
24 char buf[64];
25 foo (buf);
28 __attribute__((noinline, noclone)) void
29 f2 (void)
31 char buf[12000];
32 foo (buf);
35 __attribute__((noinline, noclone)) void
36 f3 (void)
38 char buf[131072];
39 foo (buf);
42 __attribute__((noinline, noclone)) void
43 f4 (int x)
45 char vla[x];
46 foo (vla);
49 __attribute__((noinline, noclone)) void
50 f5 (int x)
52 char buf[12000];
53 foo (buf);
55 char vla[x];
56 foo (vla);
59 char vla[x];
60 foo (vla);
64 V v;
66 __attribute__((noinline, noclone)) int
67 f6 (int x, int y, V a, V b, V c)
69 asm volatile ("" : : : "memory");
70 v = a + b + c;
71 return x + y;
74 __attribute__((noinline, noclone)) void
75 f7 (V a, V b, V c)
77 char buf[64];
78 foo (buf);
79 v = a + b + c;
82 __attribute__((noinline, noclone)) void
83 f8 (V a, V b, V c)
85 char buf[12000];
86 foo (buf);
87 v = a + b + c;
90 __attribute__((noinline, noclone)) void
91 f9 (V a, V b, V c)
93 char buf[131072];
94 foo (buf);
95 v = a + b + c;
98 __attribute__((noinline, noclone)) void
99 f10 (int x, V a, V b, V c)
101 char vla[x];
102 foo (vla);
103 v = a + b + c;
106 __attribute__((noinline, noclone)) void
107 f11 (int x, V a, V b, V c)
109 char buf[12000];
110 foo (buf);
111 v = a + b + c;
113 char vla[x];
114 foo (vla);
117 char vla[x];
118 foo (vla);
123 main ()
125 f0 (2, 3);
126 f1 ();
127 f2 ();
128 f3 ();
129 f4 (12000);
130 f5 (12000);
131 f6 (2, 3, v, v, v);
132 f7 (v, v, v);
133 f8 (v, v, v);
134 f9 (v, v, v);
135 f10 (12000, v, v, v);
136 f11 (12000, v, v, v);
137 return 0;