diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-01 14:33:32 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-01 14:33:32 +0200 |
commit | e899d4b71255b9ae096a7ecd31a61fc76f200019 (patch) | |
tree | cb1b6bcced5d1dfdcdb94e96bbf354ff8492f2fa /gcc | |
parent | 0c9a8a8c1030d072d598880c07f4d6a8d9e7deed (diff) | |
download | gcc-e899d4b71255b9ae096a7ecd31a61fc76f200019.zip gcc-e899d4b71255b9ae096a7ecd31a61fc76f200019.tar.gz gcc-e899d4b71255b9ae096a7ecd31a61fc76f200019.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr94436.c | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49a45f2..11ba84a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gcc.dg/pr94436.c b/gcc/testsuite/gcc.dg/pr94436.c new file mode 100644 index 0000000..345b595 --- /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" } */ +} |