From bbe348cd18f81dd9469c81ba6f498e01ca9c5a37 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 1 Dec 1998 09:40:02 +0000 Subject: [PATCH] Add new test based on PR 18365 From-SVN: r24025 --- gcc/testsuite/gcc.c-torture/ChangeLog | 5 ++++ .../gcc.c-torture/execute/981130-1.c | 30 +++++++++++++++++++ .../gcc.c-torture/execute/981130-1.x | 22 ++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/981130-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/981130-1.x diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog index 14cd5746146..2f85aff5f48 100644 --- a/gcc/testsuite/gcc.c-torture/ChangeLog +++ b/gcc/testsuite/gcc.c-torture/ChangeLog @@ -1,3 +1,8 @@ +1998-11-30 Nick Clifton + + * execute/981130-1.c: New test. + * execute/981130-1.x: New test failure expectations. + Sun Oct 11 05:04:28 1998 Ken Raeburn * execute/memcheck: New directory of tests for diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.c b/gcc/testsuite/gcc.c-torture/execute/981130-1.c new file mode 100644 index 00000000000..72630b07ec8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/981130-1.c @@ -0,0 +1,30 @@ +struct s { int a; int b;}; +struct s s1; +struct s s2 = { 1, 2, }; + +void +check (a, b) + int a; + int b; +{ + if (a == b) + exit (0); + else + abort (); +} + +int +main () +{ + int * p; + int x; + + s1.a = 9; + p = & s1.a; + s1 = s2; + x = * p; + + check (x, 1); +} + + diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.x b/gcc/testsuite/gcc.c-torture/execute/981130-1.x new file mode 100644 index 00000000000..1565c68adc7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/981130-1.x @@ -0,0 +1,22 @@ +# This test is known to fail on targets that use the instruction scheduler +# at optimisation levels of 2 or more because the alias analysis is confused +# by the reassignment of a variable structure to a fixed structure. The +# failure could be suppressed by preventing instruction scheduling: +# +# set additional_flags "-fno-schedule-insns2"; +# +# but this would disguise the fact that there is a problem. Instead we use +# we generate an xfail result and explain that it is alias analysis that +# is at fault. + +set torture_eval_before_execute { + + set compiler_conditional_xfail_data { + "alias analysis conflicts with instruction scheduling" \ + "m32r-*-*" \ + { "-O2" "-O1" "-O0" "-Os"} \ + { "" } + } +} + +return 0 -- 2.30.2