Skip to content

Commit c9706ff

Browse files
committed
1 parent fcb89a9 commit c9706ff

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* Disgusting, no? But it compiles and runs just fine. I feel a combination of
2+
pride and revulsion at this discovery. If no one's thought of it before,
3+
I think I'll name it after myself.
4+
It amazes me that after 10 years of writing C there are still
5+
little corners that I haven't explored fully.
6+
- Tom Duff */
7+
8+
int main()
9+
{
10+
int count, n;
11+
short *from, *to;
12+
short a[39], b[39];
13+
14+
for(n = 0; n < 39; n++) {
15+
a[n] = n;
16+
b[n] = 0;
17+
}
18+
from = a;
19+
to = b;
20+
count = 39;
21+
n = (count + 7) / 8;
22+
switch (count % 8) {
23+
case 0: do { *to++ = *from++;
24+
case 7: *to++ = *from++;
25+
case 6: *to++ = *from++;
26+
case 5: *to++ = *from++;
27+
case 4: *to++ = *from++;
28+
case 3: *to++ = *from++;
29+
case 2: *to++ = *from++;
30+
case 1: *to++ = *from++;
31+
} while (--n > 0);
32+
}
33+
for(n = 0; n < 39; n++)
34+
if(a[n] != b[n])
35+
return 1;
36+
return 0;
37+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Invalid_argument("option is None")
3+
*/
4+
// Cause: unknown
5+
6+
int x = 0;
7+
8+
int
9+
main()
10+
/*@ accesses x; @*/
11+
{
12+
switch(x)
13+
case 0:
14+
;
15+
switch(x)
16+
case 0:
17+
switch(x) {
18+
case 0:
19+
goto next;
20+
default:
21+
return 1;
22+
}
23+
return 1;
24+
next:
25+
switch(x)
26+
case 1:
27+
return 1;
28+
switch(x) {
29+
{
30+
x = 1 + 1;
31+
foo:
32+
case 1:
33+
return 1;
34+
}
35+
}
36+
switch(x) {
37+
case 0:
38+
return x;
39+
case 1:
40+
return 1;
41+
default:
42+
return 1;
43+
}
44+
}

0 commit comments

Comments
 (0)