From 6e66d62daed88ad256f1ff4d5b9eca0eca423b7f Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 5 Apr 2011 13:01:50 +0000 Subject: [PATCH] re PR target/43920 (Choosing conditional execution over conditional branches for code size in some cases.) 2011-04-05 Tom de Vries PR target/43920 * gcc.target/arm/pr43920-1.c: New test. From-SVN: r171986 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.target/arm/pr43920-1.c | 42 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/pr43920-1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84e7d7ef6e2..f60beeafec7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-05 Tom de Vries + + PR target/43920 + * gcc.target/arm/pr43920-1.c: New test. + 2011-04-04 Yufeng Zhang * g++.dg/abi/arm_cxa_vec1.C (__ARM_EABI__): Fix typo. diff --git a/gcc/testsuite/gcc.target/arm/pr43920-1.c b/gcc/testsuite/gcc.target/arm/pr43920-1.c new file mode 100644 index 00000000000..38e254c32be --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr43920-1.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-mthumb -Os" } */ +/* { dg-require-effective-target arm_thumb2_ok } */ + +int +f (int start, int end, int *start_) +{ + if (start == -1 || end == -1) + return -1; + + if (end - start) + return -1; + + *start_ = start; + + return 0; +} + +/* { dg-final { scan-assembler-times "\torr" 0 } } */ +/* { dg-final { scan-assembler-times "\tit\t" 0 } } */ +/* { dg-final { scan-assembler "\tbeq" } } */ +/* { dg-do compile } */ +/* { dg-options "-mthumb -Os" } */ +/* { dg-require-effective-target arm_thumb2_ok } */ + +int +f (int start, int end, int *start_) +{ + if (start == -1 || end == -1) + return -1; + + if (end - start) + return -1; + + *start_ = start; + + return 0; +} + +/* { dg-final { scan-assembler-times "\torr" 0 } } */ +/* { dg-final { scan-assembler-times "\tit\t" 0 } } */ +/* { dg-final { scan-assembler "\tbeq" } } */ -- 2.30.2