Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / stack-check-17.c
blob25ae97740614e3a416d27f6373acf85f8d7d2ad7
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fomit-frame-pointer" } */
3 /* { dg-require-effective-target supports_stack_clash_protection } */
4 /* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */
8 int x0, x1;
9 void f1 (void);
10 void f2 (int, int);
12 __attribute__ ((noreturn))
13 void
14 f3 (void)
16 int y0 = x0;
17 int y1 = x1;
18 f1 ();
19 f2 (y0, y1);
20 while (1);
23 /* Verify no explicit probes. */
24 /* { dg-final { scan-assembler-not "or\[ql\]" } } */
26 /* We also want to verify we did not use a push/pop sequence
27 to probe *sp as the callee register saves are sufficient
28 to probe *sp.
30 y0/y1 are live across the call and thus must be allocated
31 into either a stack slot or callee saved register. The former
32 would be rather dumb. So assume it does not happen.
34 So search for two/four pushes for the callee register saves/argument
35 pushes and no pops (since the function has no reachable epilogue). */
36 /* { dg-final { scan-assembler-times "push\[ql\]" 2 { target { ! ia32 } } } } */
37 /* { dg-final { scan-assembler-times "push\[ql\]" 4 { target { ia32 } } } } */
38 /* { dg-final { scan-assembler-not "pop" } } */