From 8bfcb75a15a6a97819f23c4ebcdb50c1aac291ee Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 5 Dec 2018 14:55:59 +0000 Subject: [PATCH] 2018-12-05 Richard Biener PR middle-end/63184 * c-c++-common/pr19807-2.c: New testcase. * c-c++-common/pr19807-3.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266827 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/c-c++-common/pr19807-2.c | 12 ++++++++++++ gcc/testsuite/c-c++-common/pr19807-3.c | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/pr19807-2.c create mode 100644 gcc/testsuite/c-c++-common/pr19807-3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b95e7942d86e..b8fb2c033d59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-12-05 Richard Biener + + PR middle-end/63184 + * c-c++-common/pr19807-2.c: New testcase. + * c-c++-common/pr19807-3.c: Likewise. + 2018-12-05 Rainer Orth PR testsuite/88208 diff --git a/gcc/testsuite/c-c++-common/pr19807-2.c b/gcc/testsuite/c-c++-common/pr19807-2.c new file mode 100644 index 000000000000..c8b2a57d6541 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr19807-2.c @@ -0,0 +1,12 @@ +/* { dg-do link } */ +/* { dg-options "-O" } */ + +extern void link_error(void); +int i; +int main() +{ + int a[4]; + if ((char*)&a[1] + 4*i + 4 != (char*)&a[i+2]) + link_error(); + return 0; +} diff --git a/gcc/testsuite/c-c++-common/pr19807-3.c b/gcc/testsuite/c-c++-common/pr19807-3.c new file mode 100644 index 000000000000..d882bd369bff --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr19807-3.c @@ -0,0 +1,12 @@ +/* { dg-do link } */ +/* { dg-options "-O" } */ + +extern void link_error(void); +int i; +int main() +{ + int a[4]; + if (&a[1] + i + 1 != &a[i+2]) + link_error(); + return 0; +} -- 2.47.2