From: Oleg Endo Date: Sun, 20 Sep 2015 14:36:58 +0000 (+0000) Subject: pr43417.c: Move target independent test to ... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4bdea2f3092425ace1a883d9c496786fdef5719;p=gcc.git pr43417.c: Move target independent test to ... gcc/testsuite/ * gcc.target/sh/pr43417.c: Move target independent test to ... * gcc.c-torture/compile/pr43417.c: ... here. From-SVN: r227945 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9142a39f367..305d6a8e476 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-20 Oleg Endo + + * gcc.target/sh/pr43417.c: Move target independent test to ... + * gcc.c-torture/compile/pr43417.c: ... here. + 2015-09-20 Oleg Endo * gcc.target/sh/sh.exp (check_effective_target_sh4a, diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43417.c b/gcc/testsuite/gcc.c-torture/compile/pr43417.c new file mode 100644 index 00000000000..45bf053a0cb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr43417.c @@ -0,0 +1,39 @@ +int pid_count = 0; + +unsigned int getopt (int, const char**, const char*); +unsigned long long atoll (const char*); +int fork (void); +void kill (int, int); + +int +main (int argc, const char *argv[]) +{ + unsigned int c; + unsigned long long maxbytes = 0; + extern const char *optarg; + int i; + int pid_cntr; + int pid; + int pid_list[1000]; + while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1)) + { + switch ((char) c) + { + case 'b': + maxbytes = atoll (optarg); + } + } + pid = fork (); + while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024)) + { + maxbytes = maxbytes - (1024 * 1024 * 1024); + pid = fork (); + if (pid != 0) + pid_cntr++; + pid_list[i] = pid; + } + while ((pid_count < pid_cntr)) + { + } + kill (pid_list[i], 9); +} diff --git a/gcc/testsuite/gcc.target/sh/pr43417.c b/gcc/testsuite/gcc.target/sh/pr43417.c deleted file mode 100644 index 67b1158950b..00000000000 --- a/gcc/testsuite/gcc.target/sh/pr43417.c +++ /dev/null @@ -1,43 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -m4" } */ - -int pid_count = 0; - -unsigned int getopt (int, const char**, const char*); -unsigned long long atoll (const char*); -int fork (void); -void kill (int, int); - -int -main (int argc, const char *argv[]) -{ - unsigned int c; - unsigned long long maxbytes = 0; - extern const char *optarg; - int i; - int pid_cntr; - int pid; - int pid_list[1000]; - while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1)) - { - switch ((char) c) - { - case 'b': - maxbytes = atoll (optarg); - } - } - pid = fork (); - while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024)) - { - maxbytes = maxbytes - (1024 * 1024 * 1024); - pid = fork (); - if (pid != 0) - pid_cntr++; - pid_list[i] = pid; - } - while ((pid_count < pid_cntr)) - { - } - kill (pid_list[i], 9); -} -