public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Add testcase for already fixed PR [PR94436]
@ 2020-04-01 12:36 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-04-01 12:36 UTC (permalink / raw)
  To: gcc-patches

Hi!

This PR has been fixed by r10-7237-g4e3d3e40726e1b68bf52fa205c68495124ea60b8
already but we didn't have a comparable testcase.

Tested on x86_64-linux -m32/-m64, committed to trunk as obvious.

2020-04-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94436
	* gcc.dg/pr94436.c: New test.

--- gcc/testsuite/gcc.dg/pr94436.c.jj
+++ gcc/testsuite/gcc.dg/pr94436.c
@@ -0,0 +1,13 @@
+/* PR middle-end/94436 */
+/* { dg-do compile } */
+/* { dg-options "-Wincompatible-pointer-types" } */
+
+struct S { int s; };
+int foo (struct S *);
+
+int
+bar (void)
+{
+  int s = 0;
+  return foo ((struct S *) ((char *) &s - (char *) &((struct S *) 0)->s));	/* { dg-bogus "from incompatible pointer type" } */
+}

	Jakub


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

only message in thread, other threads:[~2020-04-01 12:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 12:36 [PATCH] testsuite: Add testcase for already fixed PR [PR94436] Jakub Jelinek

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