From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Testcases PR63184
Date: Wed, 05 Dec 2018 14:55:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.20.1812051555040.1827@zhemvz.fhfr.qr> (raw)
Committed.
Richard.
2018-12-05 Richard Biener <rguenther@suse.de>
PR middle-end/63184
* c-c++-common/pr19807-2.c: New testcase.
* c-c++-common/pr19807-3.c: Likewise.
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 00000000000..c8b2a57d654
--- /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 00000000000..d882bd369bf
--- /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;
+}
reply other threads:[~2018-12-05 14:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.20.1812051555040.1827@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).