]> andersk Git - splint.git/blame - test/tests2.2a/obviousloop.c
Hacking Makefile to print a warning when test suite to run under /usr
[splint.git] / test / tests2.2a / obviousloop.c
CommitLineData
885824d3 1int f (void)
2{
3 int x = 3;
4
5 while (TRUE)
6 {
7 x++;
8
9 if (x == 12) {
10 return 12;
11 }
12 }
13
14 x = 12; /* unreachable */
15}
16
17int f1 (void)
18{
19 int x = 3;
20
21 while (TRUE)
22 {
23 x++;
24
25 if (x == 12) {
26 return 12;
27 }
28
29 if (x == 8) {
30 break;
31 }
32 }
33
34 x = 12;
35 /* no return */
36}
37
38int f1b (void)
39{
40 int x = 3;
41
42 while (TRUE)
43 {
44 x++;
45
46 if (x == 12) {
47 return 12;
48 }
49
50 if (x == 8) {
51 for (x = 2; x < 2; x++) {
52 if (x == 4) {
53 break;
54 }
55 }
56 }
57 }
58
59 x = 12; /* unreachable */
60}
61
62int f2 (void)
63{
64 int x = 3;
65
66 for (;;)
67 {
68 x++;
69
70 if (x == 12) {
71 return 12;
72 }
73 }
74
75 x = 12; /* unreachable */
76}
77
This page took 0.073258 seconds and 5 git commands to generate.