Message ID | 87b44d5d-4277-8979-67a5-6e806f28eccc@foss.arm.com |
---|---|
State | New |
Headers | show |
On 2 December 2016 at 17:35, Thomas Preudhomme <thomas.preudhomme@foss.arm.com> wrote: > Hi, > > The logic to make -mthumb optional for Thumb-only targets was designed to > only apply when no mode is specified either at compile time or when the > toolchain was configured (using --with-mode). The dg-skip-if in the > testcases optional_thumb-1 and optional_thumb-2 catch the former case but > not the latter. Unfortunately there is no dejagnu procedure to check the > presence of an option in the configure line used for the compiler. This > patch marks the two tests as XFAIL since that will at least allow to catch a > change from PASS to XFAIL, thus making the test still useful. It also fixes > a codestyle issue in the target triplet of the dg-skip-if directives of all > the optional_thumb-* testcases. > So, this makes the test XPASS when no --with-mode or --with-mode=thumb is used. Isn't it possible to add an dejagnu effective target to detect this configure option? I guess you looked at that but the effort is not worth it? Christophe > ChangeLog entry is as follows: > > *** gcc/testsuite/ChangeLog *** > > 2016-12-01 Thomas Preud'homme <thomas.preudhomme@arm.com> > > * gcc.target/arm/optional_thumb-3.c: Fix codestyle issue in target > triplet of dg-skip-if. > * gcc.target/arm/optional_thumb-1.c: Likewise and add xfail. > * gcc.target/arm/optional_thumb-2.c: Likewise. > > Is this ok for stage3? > > Best regards, > > Thomas
On 05/12/16 09:01, Christophe Lyon wrote: > On 2 December 2016 at 17:35, Thomas Preudhomme > <thomas.preudhomme@foss.arm.com> wrote: >> Hi, >> >> The logic to make -mthumb optional for Thumb-only targets was designed to >> only apply when no mode is specified either at compile time or when the >> toolchain was configured (using --with-mode). The dg-skip-if in the >> testcases optional_thumb-1 and optional_thumb-2 catch the former case but >> not the latter. Unfortunately there is no dejagnu procedure to check the >> presence of an option in the configure line used for the compiler. This >> patch marks the two tests as XFAIL since that will at least allow to catch a >> change from PASS to XFAIL, thus making the test still useful. It also fixes >> a codestyle issue in the target triplet of the dg-skip-if directives of all >> the optional_thumb-* testcases. >> > > So, this makes the test XPASS when no --with-mode or --with-mode=thumb > is used. Yes. At least we can still see change from XPASS to XFAIL and not let people worry if they build GCC with --with-mode=* and the test fails. > > Isn't it possible to add an dejagnu effective target to detect this > configure option? I guess you looked at that but the effort is not worth it? Since we can run the compiler to compile testcases it should be possible to run it with -v and then check the output for something. However that would involve more code so would take me more time to come up with a solution and I want to have a solution for the short term. Best regards, Thomas
diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-1.c b/gcc/testsuite/gcc.target/arm/optional_thumb-1.c index 23df62887ba4aaa1d8717a34ecda9a40246f0552..27787bb8a403534abf708be02a80bdcf42638958 100644 --- a/gcc/testsuite/gcc.target/arm/optional_thumb-1.c +++ b/gcc/testsuite/gcc.target/arm/optional_thumb-1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ -/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-*} { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */ +/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-* } { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */ /* { dg-options "-march=armv6-m" } */ +/* { dg-xfail-if "fails if GCC configured with --with-mode=arm" { *-*-* } } */ /* Check that -mthumb is not needed when compiling for a Thumb-only target. */ diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-2.c b/gcc/testsuite/gcc.target/arm/optional_thumb-2.c index 4bd53a45eca97e62dd3b86d5a1a66c5ca21e7aad..5a8e5e8cfccf8d9175432ef6b5c07cb0b5f7b0bf 100644 --- a/gcc/testsuite/gcc.target/arm/optional_thumb-2.c +++ b/gcc/testsuite/gcc.target/arm/optional_thumb-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ -/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-*} { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */ +/* { dg-skip-if "-marm/-mthumb/-march/-mcpu given" { *-*-* } { "-marm" "-mthumb" "-march=*" "-mcpu=*" } } */ /* { dg-options "-mcpu=cortex-m4" } */ +/* { dg-xfail-if "fails if GCC configured with --with-mode=arm" { *-*-* } } */ /* Check that -mthumb is not needed when compiling for a Thumb-only target. */ diff --git a/gcc/testsuite/gcc.target/arm/optional_thumb-3.c b/gcc/testsuite/gcc.target/arm/optional_thumb-3.c index f1fd5c8840b191e600c20a7817c611bb9bb645df..735c2774738c8d84deb14a9f082c34bf622b2d5d 100644 --- a/gcc/testsuite/gcc.target/arm/optional_thumb-3.c +++ b/gcc/testsuite/gcc.target/arm/optional_thumb-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_cortex_m } */ -/* { dg-skip-if "-mthumb given" { *-*-*} { "-mthumb" } } */ +/* { dg-skip-if "-mthumb given" { *-*-* } { "-mthumb" } } */ /* { dg-options "-marm" } */ /* { dg-error "target CPU does not support ARM mode" "missing error with -marm on Thumb-only targets" { target *-*-*} 0 } */