File: main.cpp

package info (click to toggle)
lcov 2.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,464 kB
  • sloc: perl: 27,911; sh: 7,320; xml: 6,982; python: 1,152; makefile: 597; cpp: 520; ansic: 176
file content (72 lines) | stat: -rw-r--r-- 1,461 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "test.h"

#define macro_1(expr)                   \
  do                                    \
  {                                     \
  } while (expr)

#define macro_2(i, expr1, expr2)        \
    do {                                \
        ++(i);                          \
        if (!(expr1))                   \
            ++(i);                      \
        if (!(expr2))                   \
            ++(i);                      \
    } while((expr1) && (expr2));

#define macro_3(expr) macro_1((expr))

void foo(char a)
{
        if (a)
        /* comment

         */ return;
}

int main() {
    int a[] = {3, 12}; /* comment */
    int i; /* comment
              comment
    comment */ i = 0;
    macro_1(i < 0);
    macro_1 (
        BOOL(i < 0 && i % 2 == 0))
        ;
    macro_2(i, i < 10, i > 0);
    i = 0;
    macro_3(i < 0);
    macro_4(i < 0 || i > 0 && i < 10);
    if (BOOL(i > 0) ||
        i <= 0)
        ;

    if (BOOL(i > 0)
        && BOOL(i < 0))
    {
        ;
    }

    for (; i < sizeof(a) / sizeof(*a); ++i)

    {
        if ((a[i] % 4
                    == 0)
                &&
                (a[i] % 3
                    == 0))
        {
            ;
        }
        if (a[i] < 10)
            ;
        foo(a[i] && i < 1);
    }
    /* i == 2
    */
    do {
        --i;
    } while (i);
    while(i < 2 && i < 3 && i < 4) { ++i; } for(i = 0; i < 5 && i < 4; ++i) { (void)i; }
    return 0;
}