public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/guojiufu/heads/guojiufu-branch)] update test case format
@ 2021-06-09 11:19 Jiu Fu Guo
  0 siblings, 0 replies; only message in thread
From: Jiu Fu Guo @ 2021-06-09 11:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c7f79cbb461666ed0d6191866216af850e8a9cd4

commit c7f79cbb461666ed0d6191866216af850e8a9cd4
Author: Jiufu Guo <guojiufu@linux.ibm.com>
Date:   Wed Jun 9 17:37:27 2021 +0800

    update test case format

Diff:
---
 gcc/testsuite/gcc.dg/loop-split2.c | 48 +++++++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/loop-split2.c b/gcc/testsuite/gcc.dg/loop-split2.c
index 1c7fd1bede1..5b75793ba87 100644
--- a/gcc/testsuite/gcc.dg/loop-split2.c
+++ b/gcc/testsuite/gcc.dg/loop-split2.c
@@ -1,9 +1,12 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
 
-extern void abort (void);
-extern void exit (int);
-void push (int);
+extern void
+abort (void);
+extern void
+exit (int);
+void
+push (int);
 
 #define NI __attribute__ ((noinline))
 
@@ -22,7 +25,7 @@ bar (int *a, int *b, unsigned char l, unsigned char n)
       push (l);
       if (a[l] != b[l])
 	break;
-      push (l+1);    
+      push (l + 1);
     }
   return l;
 }
@@ -42,7 +45,7 @@ bar_1 (int *a, int *b, unsigned char l, unsigned char n)
       push (l);
       if (a[l] != b[l])
 	break;
-      push (l+1);    
+      push (l + 1);
     }
 
   return l;
@@ -52,27 +55,30 @@ int a[258];
 int b[258];
 int c[1024];
 static int top = 0;
-void push (int e)
+void
+push (int e)
 {
   c[top++] = e;
 }
 
-void reset ()
+void
+reset ()
 {
   top = 0;
   __builtin_memset (c, 0, sizeof (c));
 }
 
-#define check(a, b) (b == -1 || a == b)
+#define check(a, b) (a == b)
 
 int
 check_c (int *c, int a0, int a1, int a2, int a3, int a4, int a5)
 {
   return check (c[0], a0) && check (c[1], a1) && check (c[2], a2)
-    && check (c[3], a3) && check (c[4], a4) && check (c[5], a5);
+	 && check (c[3], a3) && check (c[4], a4) && check (c[5], a5);
 }
 
-int main ()
+int
+main ()
 {
   __builtin_memcpy (b, a, sizeof (a));
   reset ();
@@ -89,23 +95,23 @@ int main ()
     abort ();
 
   reset ();
-  if (bar (a, b, 253, 255) != 0 || !check_c (c, 254, 255, 255, 256,-1,-1))
+  if (bar (a, b, 253, 255) != 0 || !check_c (c, 254, 255, 255, 256, -1, -1))
     abort ();
 
   reset ();
   if (bar (a, b, 253, 0) != 1 || !check_c (c, 254, 255, 255, 256, 0, 1))
     abort ();
-  
+
   reset ();
   if (bar_1 (a, b, 6, 8) != 7 || !check_c (c, 5, 6, 4, 5, 3, 4))
     abort ();
 
   reset ();
-  if (bar_1 (a, b, 5, 3) != 2 || !check_c (c, 4, 5, 3, 4,-1,-1 ))
+  if (bar_1 (a, b, 5, 3) != 2 || !check_c (c, 4, 5, 3, 4, -1, -1))
     abort ();
 
   reset ();
-  if (bar_1 (a, b, 6, 6) != 5) 
+  if (bar_1 (a, b, 6, 6) != 5)
     abort ();
 
   reset ();
@@ -115,10 +121,9 @@ int main ()
   reset ();
   if (bar_1 (a, b, 2, 0) != 255 || !check_c (c, 1, 2, 0, 1, 0, 0))
     abort ();
-  
-  
+
   b[100] += 1;
-  reset ();  
+  reset ();
   if (bar (a, b, 90, 110) != 100)
     abort ();
 
@@ -133,19 +138,18 @@ int main ()
   reset ();
   if (bar_1 (a, b, 2, 90) != 100)
     abort ();
-  
+
   foo (a, b, 99, 99);
   a[99] = b[99] + 1;
   for (int i = 0; i < 256; i++)
     if (a[i] != b[i] + 1)
-      abort();
+      abort ();
 
   foo_1 (a, b, 99, 99);
   a[99] = b[99] + 1;
   for (int i = 0; i < 256; i++)
     if (a[i] != b[i] + 1)
-      abort();
-  
+      abort ();
+
   exit (0);
 }
-


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-09 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 11:19 [gcc(refs/users/guojiufu/heads/guojiufu-branch)] update test case format Jiu Fu Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).