summaryrefslogtreecommitdiff
path: root/test/test18.cpp
blob: e830e267391021d37117ae8d45833a3b399b1a6a (plain) (blame)
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
struct Data1
{
    int val;
};

int k;

int func1(struct Data1 *ptr1, struct Data1 *ptr2)
{
    if (ptr1 ? 0 : 1)
        return(0);

    ptr1->val = 100;
}

int func2(struct Data1 *ptr1, struct Data1 *ptr2)
{
    if (ptr1 == (123, 0))
        return 0;
    ptr1->val = 100;
    return 0;
}

int func3(struct Data1 *ptr1, struct Data1 *ptr2)
{
    if (ptr1 != (123, 0))
        return 0;
    ptr1->val = 100;
    return 0;
}

void func4(struct Data1 *ptr1, struct Data1 *ptr2)
{
    if (k == 10)
    {
        if (!ptr1)
            return;
    }

    ptr1->val = 100;
}

void func5(struct Data1 *ptr1, struct Data1 *ptr2)
{
    if (!ptr1)
        return;

    if (ptr2)
        return;

    ptr1->val = 100;
}