Patchwork [PR43920,2/9] ARM specific part - test case

login
register
mail settings
Submitter Tom de Vries
Date March 31, 2011, 6:27 p.m.
Message ID <4D94C787.4060207@codesourcery.com>
Download mbox | patch
Permalink /patch/89105/
State New
Headers show

Comments

Tom de Vries - March 31, 2011, 6:27 p.m.
A testcase for the code in arm-size-branch_cost.patch.

Thanks,
- Tom

Patch

Index: gcc/testsuite/gcc.target/arm/pr43920-1.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr43920-1.c	(revision 0)
+++ gcc/testsuite/gcc.target/arm/pr43920-1.c	(revision 0)
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mthumb -Os" } */
+
+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" } } */