missing_break: turn it off by default
[smatch.git] / validation / backend / sum.c
blob06042999f413fa4268ac8ac7d7ff2734d99dcd9a
1 #include <stdio.h>
2 #include <stdlib.h>
4 static int sum(int n)
6 int i, result = 0;
8 for (i = 1; i <= n; ++i)
9 result += i;
10 return result;
13 int main(int argc, char **argv)
15 printf("%d\n", sum(5));
16 printf("%d\n", sum(100));
17 return 0;
21 * check-name: sum from 1 to n
22 * check-command: sparsei $file
24 * check-output-start
26 5050
27 * check-output-end