public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add test for PR52769
@ 2014-10-29 10:28 Marek Polacek
  2014-10-29 12:31 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2014-10-29 10:28 UTC (permalink / raw)
  To: GCC Patches

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?

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add test for PR52769
  2014-10-29 10:28 [PATCH] Add test for PR52769 Marek Polacek
@ 2014-10-29 12:31 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2014-10-29 12:31 UTC (permalink / raw)
  To: Marek Polacek; +Cc: GCC Patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-29 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 10:28 [PATCH] Add test for PR52769 Marek Polacek
2014-10-29 12:31 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).