From: Kyrylo Tkachov Date: Fri, 19 Jan 2018 10:26:53 +0000 (+0000) Subject: [arm] Fix gcc.target/arm/pr40956.c X-Git-Tag: upstream/12.2.0~33935 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f14d763affc5a001506f485e826ab110b4a2969;p=platform%2Fupstream%2Fgcc.git [arm] Fix gcc.target/arm/pr40956.c The scan-assembler tests here check for MOVS for Thumb1 and MOV for Thumb2, but in fact there's no reason why we wouldn't generate MOVS for Thumb2 as well, it really depends on a lot of optimisation decisions. The only behaviour we want to test is that we move a 0 constant into a register only once, which can be achieved with either MOV or MOVS. Simplify the check by always checking for either MOV or MOVS. * gcc.target/arm/pr40956.c: Adjust scan-assembler pattern. From-SVN: r256880 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d86316e..a0000cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-01-19 Kyrylo Tkachov + * gcc.target/arm/pr40956.c: Adjust scan-assembler pattern. + +2018-01-19 Kyrylo Tkachov + * gcc.target/arm/pr79058.c: Add arm_arm_ok check and -marm to options. 2018-01-18 John David Anglin diff --git a/gcc/testsuite/gcc.target/arm/pr40956.c b/gcc/testsuite/gcc.target/arm/pr40956.c index 4fefa49..7429272 100644 --- a/gcc/testsuite/gcc.target/arm/pr40956.c +++ b/gcc/testsuite/gcc.target/arm/pr40956.c @@ -1,8 +1,7 @@ /* { dg-options "-Os -fpic" } */ /* { dg-require-effective-target fpic } */ /* Make sure the constant "0" is loaded into register only once. */ -/* { dg-final { scan-assembler-times "movs\[\\t \]*r., #0" 1 { target arm_thumb1 } } } */ -/* { dg-final { scan-assembler-times "mov\[\\t \]*r., #0" 1 { target { ! arm_thumb1 } } } } */ +/* { dg-final { scan-assembler-times "movs?\[\\t \]*r., #0" 1 } } */ int foo(int p, int* q) {