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]

[SH] PR 40797 testcase


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.
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);
+}

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