public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jiu Fu Guo <guojiufu@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/guojiufu/heads/guojiufu-branch)] update test case format Date: Wed, 9 Jun 2021 11:19:56 +0000 (GMT) [thread overview] Message-ID: <20210609111956.78DB6395C826@sourceware.org> (raw) 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); } -
reply other threads:[~2021-06-09 11:19 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210609111956.78DB6395C826@sourceware.org \ --to=guojiufu@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).