xref: /llvm-project/llvm/test/tools/llvm-cov/Inputs/mcdc-general.cpp (revision ae36790be4a2a6c9dc8900f659c861647cab66d5)
1 #include <stdio.h>
2 
3 
4 
5 
6 
7 
8 
9 
test(bool a,bool b,bool c,bool d)10 void test(bool a, bool b, bool c, bool d) {
11 
12   if ((a && b) || (c && d))
13     printf("test1 decision true\n");
14 
15   if (b && c) if (a && d)
16     printf("test2 decision true\n");
17 
18   if ((c && d) &&
19       (a && b))
20     printf("test3 decision true\n");
21 }
22 
main()23 int main()
24 {
25     test(false,false,false,false);
26     test(true,false,true,false);
27     test(true,false,true,true);
28     test(true,true,false,false);
29 
30     test(true,false,false,false);
31     test(true,true,true,true);
32     test(false,true,true,false);
33 
34     (void)0;
35     return 0;
36 }
37