Optimize testcase

Message ID 20221115121345.3650155-1-chenyixuan@iscas.ac.cn
State New
Headers
Series Optimize testcase |

Commit Message

Yixuan Chen Nov. 15, 2022, 12:13 p.m. UTC
  From: Oria Chen <oriachiuan@gmail.com>

gcc/testsuite/ChangeLog:

2022-11-15  Yixuan Chen  <chenyixuan@iscas.ac.cn>

        * gcc.dg/fold-overflow-1.c: Optimize testcase, because riscv will use ".LC0" intead of ".LC1" and ".LC2" with "-O" compile option
---
 gcc/testsuite/gcc.dg/fold-overflow-1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Jakub Jelinek Nov. 15, 2022, 12:17 p.m. UTC | #1
On Tue, Nov 15, 2022 at 08:13:45PM +0800, Yixuan Chen wrote:
> From: Oria Chen <oriachiuan@gmail.com>
> 
> gcc/testsuite/ChangeLog:
> 
> 2022-11-15  Yixuan Chen  <chenyixuan@iscas.ac.cn>
> 
>         * gcc.dg/fold-overflow-1.c: Optimize testcase, because riscv will use ".LC0" intead of ".LC1" and ".LC2" with "-O" compile option

This is wrong.
See https://gcc.gnu.org/PR107608

	Jakub
  

Patch

diff --git a/gcc/testsuite/gcc.dg/fold-overflow-1.c b/gcc/testsuite/gcc.dg/fold-overflow-1.c
index 108df4e3155..02598bfa3d3 100644
--- a/gcc/testsuite/gcc.dg/fold-overflow-1.c
+++ b/gcc/testsuite/gcc.dg/fold-overflow-1.c
@@ -18,5 +18,6 @@  float foo2(void)
   return 1.0f/0.0f;
 }
 
-/* { dg-final { scan-assembler-times "2139095040" 2 { target { ! mmix-*-* } } } } */
+/* { dg-final { scan-assembler-times "2139095040" 2 { target { ! { mmix-*-*  riscv*-*-* } } } } } */
 /* { dg-final { scan-assembler-times "#7f800000" 2 { target mmix-*-* } } } */
+/* { dg-final { scan-assembler-times "2139095040" 3 { target riscv*-*-* } } } */