From 97f87df9fe13dcbbf89cd426c30a9aa1661f2e50 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 21 Jun 2015 02:13:25 +0300 Subject: Add test16. --- test/test16.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 test/test16.c (limited to 'test/test16.c') diff --git a/test/test16.c b/test/test16.c new file mode 100644 index 0000000..beb5187 --- /dev/null +++ b/test/test16.c @@ -0,0 +1,69 @@ +struct Data1 +{ + int val; +}; + +int k; + +void func1(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if (!ptr1 || ptr1->val == 100) + { + return; + } + + ptr1->val = 200; +} + +void func2(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if (ptr1 && ptr1->val == 100) + { + ptr1->val = 200; + return; + } + + ptr1->val = 300; +} + +void func3(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if (ptr1 || ptr1->val == 100) + { + return; + } + + ptr1->val = 200; +} + +void func4(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if (!ptr1 && ptr1->val == 100) + { + return; + } + + ptr1->val = 200; +} + +void func5(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if ((!ptr1 || ptr1->val == 100) || (!ptr2 || ptr2->val == 200)) + { + return; + } + + ptr1->val = 300; + ptr2->val = 400; +} + +void func6(struct Data1 *ptr1, struct Data1 *ptr2) +{ + if ((!ptr1 || ptr1->val == 100) && (!ptr2 || ptr2->val == 200)) + { + return; + } + + ptr1->val = 300; + ptr2->val = 400; +} -- cgit v1.2.3-70-g09d2