diff options
author | Jeff Law <law@redhat.com> | 2018-01-19 11:42:30 -0700 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-01-19 19:42:30 +0100 |
commit | 2af6483634c6f369731a6de07631921a570ff178 (patch) | |
tree | ce8c15ad9cabf9636192e7116b8731e08c29396c /gcc | |
parent | 47c699f52a0a226abc93e7e5ecf78569cc4291fe (diff) | |
download | gcc-2af6483634c6f369731a6de07631921a570ff178.zip gcc-2af6483634c6f369731a6de07631921a570ff178.tar.gz gcc-2af6483634c6f369731a6de07631921a570ff178.tar.bz2 |
stack-check-16.c: New test.
* gcc.dg/stack-check-16.c: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r256896
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/stack-check-16.c | 36 |
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f446248..2d0e317 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-19 Jeff Law <law@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + * gcc.dg/stack-check-16.c: New test. + 2018-01-19 Cesar Philippidis <cesar@codesourcery.com> PR target/83790 diff --git a/gcc/testsuite/gcc.dg/stack-check-16.c b/gcc/testsuite/gcc.dg/stack-check-16.c new file mode 100644 index 0000000..9f89a79 --- /dev/null +++ b/gcc/testsuite/gcc.dg/stack-check-16.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-fstack-clash-protection" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ + +int printf (const char *, ...); +void blah (char *space) { } +void mtrace (void); + +int do_test (void) +{ + blah (__builtin_alloca (10)); + mtrace (); + printf ( +#define A(a) "%" #a "$s" +#define B(a) A(a) +#define C(a,b,c,d) B(a##b##c##d) +#define D(a,b,c) C(a,b,c,1) C(a,b,c,2) C(a,b,c,3) C(a,b,c,4) C(a,b,c,5) \ + C(a,b,c,6) C(a,b,c,7) C(a,b,c,8) C(a,b,c,9) +#define E(a,b,c) C(a,b,c,0) D(a,b,c) +#define F(a,b) E(a,b,1) E(a,b,2) E(a,b,3) E(a,b,4) E(a,b,5) \ + E(a,b,6) E(a,b,7) E(a,b,8) E(a,b,9) +#define G(a,b) E(a,b,0) F(a,b) +#define H(a) G(a,1) G(a,2) G(a,3) G(a,4) G(a,5) G(a,6) G(a,7) G(a,8) G(a,9) +#define I(a) G(a,0) H(a) +#define J I(1) I(2) I(3) I(4) I(5) I(6) I(7) I(8) I(9) + D(,,) + F(,) + H() + J + C(10,0,0,0) C(10,0,0,1), +#undef A +#define A(a) "a", + I(0) J + "\n"); + return 0; +} |