Patchwork [SH] PR 40797 testcase

login
register
mail settings
Submitter Oleg Endo
Date March 10, 2013, 12:42 p.m.
Message ID <1362919376.2219.185.camel@yam-132-YW-E178-FTW>
Download mbox | patch
Permalink /patch/226430/
State New
Headers show

Comments

Oleg Endo - March 10, 2013, 12:42 p.m.
Hi,

This adds the reduced test case from the PR to the test suite.
Tested with

make -k check-gcc RUNTESTFLAGS="compile.exp=pr40797*
--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

OK for trunk?

Cheers,
Oleg

testsuite/ChangeLog:

	PR target/40797
	* gcc.c-torture/compile/pr40797.c: New.
Kaz Kojima - March 11, 2013, 12:11 a.m.
Oleg Endo <oleg.endo@t-online.de> wrote:
> This adds the reduced test case from the PR to the test suite.
> Tested with
> 
> make -k check-gcc RUNTESTFLAGS="compile.exp=pr40797*
> --target_board=sh-sim
> \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
> 
> OK for trunk?

OK.

Regards,
	kaz

Patch

Index: gcc/testsuite/gcc.c-torture/compile/pr40797.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr40797.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr40797.c	(revision 0)
@@ -0,0 +1,16 @@ 
+typedef struct str { short x, y;} S;
+
+static short
+bar (short ch, short sl, short sr, short tl, short tr)
+{
+  return 0;
+}
+
+void
+foo (short ch, S *pi, short nc, S *po)
+{
+  short clo, chi, lo, hi;
+
+  po->x = bar (ch, clo, chi, pi[lo].x, pi[hi].x);
+  po->y = bar (ch, clo, chi, pi[lo].y, pi[hi].y);
+}