[PATCH] Add test for PR52769
Richard Biener
richard.guenther@gmail.com
Wed Oct 29 12:31:00 GMT 2014
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
More information about the Gcc-patches
mailing list