public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Testcases PR63184
@ 2018-12-05 14:55 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2018-12-05 14:55 UTC (permalink / raw)
  To: gcc-patches


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;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-05 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 14:55 [PATCH] Testcases PR63184 Richard Biener

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).