Add testcase for already fixed PR [PR94436]

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

	PR middle-end/94436
	* gcc.dg/pr94436.c: New test.
This commit is contained in:
Jakub Jelinek 2020-04-01 14:33:32 +02:00
parent 0c9a8a8c10
commit e899d4b712
2 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2020-04-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/94436
* gcc.dg/pr94436.c: New test.
PR middle-end/94423
* gcc.dg/ubsan/pr94423.c: New test.

View File

@ -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" } */
}