Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/980605-1.c

raw
1 /* { dg-add-options stack_size } */
2
3 #include <stdio.h>
4
5 void abort (void);
6 void exit (int);
7
8 #ifndef STACK_SIZE
9 #define STACK_SIZE 200000
10 #endif
11
12 __inline__ static int
13 dummy (int x)
14 {
15 int y;
16 y = (long) (x * 4711.3);
17 return y;
18 }
19
20 int getval (void);
21
22 int
23 f2 (double x)
24 {
25 unsigned short s;
26 int a, b, c, d, e, f, g, h, i, j;
27
28 a = getval ();
29 b = getval ();
30 c = getval ();
31 d = getval ();
32 e = getval ();
33 f = getval ();
34 g = getval ();
35 h = getval ();
36 i = getval ();
37 j = getval ();
38
39
40 s = x;
41
42 return a + b + c + d + e + f + g + h + i + j + s;
43 }
44
45 int x = 1;
46
47 int
48 getval (void)
49 {
50 return x++;
51 }
52
53 char buf[10];
54
55 void
56 f ()
57 {
58 char ar[STACK_SIZE/2];
59 int a, b, c, d, e, f, g, h, i, j, k;
60
61 a = getval ();
62 b = getval ();
63 c = getval ();
64 d = getval ();
65 e = getval ();
66 f = getval ();
67 g = getval ();
68 h = getval ();
69 i = getval ();
70 j = getval ();
71
72 k = f2 (17.0);
73
74 sprintf (buf, "%d\n", a + b + c + d + e + f + g + h + i + j + k);
75 if (a + b + c + d + e + f + g + h + i + j + k != 227)
76 abort ();
77 }
78
79 int
80 main (void)
81 {
82 f ();
83 exit (0);
84 }