From: Jakub Jelinek Date: Wed, 1 Apr 2020 12:33:32 +0000 (+0200) Subject: Add testcase for already fixed PR [PR94436] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e899d4b71255b9ae096a7ecd31a61fc76f200019;p=gcc.git Add testcase for already fixed PR [PR94436] 2020-04-01 Jakub Jelinek PR middle-end/94436 * gcc.dg/pr94436.c: New test. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49a45f2854e..11ba84a00e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2020-04-01 Jakub Jelinek + PR middle-end/94436 + * gcc.dg/pr94436.c: New test. + PR middle-end/94423 * gcc.dg/ubsan/pr94423.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr94436.c b/gcc/testsuite/gcc.dg/pr94436.c new file mode 100644 index 00000000000..345b5958a19 --- /dev/null +++ b/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" } */ +}