Debian Codegraph @

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

raw
1 void abort (void);
2 void exit (int);
3
4 int ops[13] =
5 {
6 11, 12, 46, 3, 2, 2, 3, 2, 1, 3, 2, 1, 2
7 };
8
9 int correct[13] =
10 {
11 46, 12, 11, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1
12 };
13
14 int num = 13;
15
16 int main()
17 {
18 int i;
19
20 for (i = 0; i < num; i++)
21 {
22 int j;
23
24 for (j = num - 1; j > i; j--)
25 {
26 if (ops[j-1] < ops[j])
27 {
28 int op = ops[j];
29 ops[j] = ops[j-1];
30 ops[j-1] = op;
31 }
32 }
33 }
34
35
36 for (i = 0; i < num; i++)
37 if (ops[i] != correct[i])
38 abort ();
39
40 exit (0);
41 }
42