Commit | Line | Data |
---|---|---|
755320b0 C |
1 | /* An indirect way to compute zero, for an external analysis to find out. */ |
2 | ||
3 | #include <stdio.h> | |
4 | ||
5 | int sum(const int x, const int y) { | |
6 | return x + y; | |
7 | } | |
8 | ||
9 | int add4(const int z) { | |
10 | return sum(z, 1) + 3; | |
11 | } | |
12 | ||
13 | int main() { | |
14 | int x = add4(1) - 5; /* should be zero */ | |
15 | ||
16 | if (x) { | |
17 | printf("Dead code."); | |
18 | } | |
19 | ||
20 | int y = getchar() < 0; /* can happen */ | |
21 | if (y) { | |
22 | printf("Not dead code."); | |
23 | } | |
24 | ||
25 | return 0; | |
26 | } |