This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add test for PR52769


On Wed, Oct 29, 2014 at 11:24 AM, Marek Polacek <polacek@redhat.com> wrote:
> PR52769 reports a bug that has been fixed in 4.7, but the test case
> was never added.  So I'd like to put this test in and close PR52769.
>
> Ok?

Ok everywhere.

Thanks,
Richard.

> 2014-10-29  Marek Polacek  <polacek@redhat.com>
>
>         PR c/52769
>         * gcc.dg/pr52769.c: New test.
>
> diff --git gcc/testsuite/gcc.dg/pr52769.c gcc/testsuite/gcc.dg/pr52769.c
> index e69de29..138cecb 100644
> --- gcc/testsuite/gcc.dg/pr52769.c
> +++ gcc/testsuite/gcc.dg/pr52769.c
> @@ -0,0 +1,24 @@
> +/* PR c/52769 */
> +/* { dg-do run } */
> +/* { dg-options "-O3" } */
> +
> +typedef struct
> +{
> +  int should_be_zero;
> +  char s[6];
> +  int x;
> +} foo_t;
> +
> +int
> +main (void)
> +{
> +  volatile foo_t foo = {
> +    .s = "123456",
> +    .x = 2
> +  };
> +
> +  if (foo.should_be_zero != 0)
> +    __builtin_abort ();
> +
> +  return 0;
> +}
>
>         Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]