function_hooks: update comment explaining various function hooks
[smatch.git] / validation / sm_struct_assign1.c
blobaa3067ecaffc391a538cdb49476e3c6a5faefc86
1 #include "check_debug.h"
3 void memcpy(void *dest, void *src, int size);
4 void memset(void *dest, char c, int size);
7 struct foo {
8 int x, y;
9 };
11 void test(void)
13 struct foo src = {1, 41};
14 struct foo dest;
16 memcpy(&dest, &src, sizeof(dest));
17 __smatch_implied(dest.x + dest.y);
18 memset(&dest, 0, sizeof(dest));
19 __smatch_implied(dest.x + dest.y);
24 * check-name: smatch struct assignment #1
25 * check-command: smatch -I.. sm_struct_assign1.c
27 * check-output-start
28 sm_struct_assign1.c:17 test() implied: dest.x + dest.y = '42'
29 sm_struct_assign1.c:19 test() implied: dest.x + dest.y = '0'
30 * check-output-end