OSDN Git Service

PR middle-end/29274
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / sh / pr43417.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -m4" } */
3
4 int pid_count = 0;
5 main (int argc, char *argv[])
6 {
7   unsigned int c;
8   unsigned long long maxbytes = 0;
9   extern char *optarg;
10   int i;
11   int pid_cntr;
12   int pid;
13   int pid_list[1000];
14   while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1))
15     {
16       switch ((char) c)
17         {
18         case 'b':
19           maxbytes = atoll (optarg);
20         }
21     }
22   pid = fork ();
23   while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024))
24     {
25       maxbytes = maxbytes - (1024 * 1024 * 1024);
26       pid = fork ();
27       if (pid != 0)
28         pid_cntr++;
29       pid_list[i] = pid;
30     }
31   while ((pid_count < pid_cntr))
32     {
33     }
34   kill (pid_list[i], 9);
35 }
36