struct_assignment: handle memcpy(foo, ...) where foo is not a struct
[smatch.git] / validation / sm_buf_size5.c
blobca19a30c23009e2408530abc41d02fe1def5f5ad
1 #include "check_debug.h"
3 struct foo {
4 char buf[42];
5 int x[4];
6 };
8 int function(void)
10 struct foo foo;
12 __smatch_buf_size(&foo);
13 __smatch_buf_size(&(foo.buf[0]));
14 __smatch_buf_size(&foo.x[0]);
15 __smatch_buf_size(&foo.x[1]);
17 return 0;
20 * check-name: smatch buf size #5
21 * check-command: smatch --spammy -I.. sm_buf_size5.c
23 * check-output-start
24 sm_buf_size5.c:12 function() buf size: '&foo' 1 elements, 60 bytes
25 sm_buf_size5.c:13 function() buf size: '&(foo.buf[0])' 42 elements, 42 bytes
26 sm_buf_size5.c:14 function() buf size: '&foo.x[0]' 4 elements, 16 bytes
27 sm_buf_size5.c:15 function() buf size: '&foo.x[1]' 0 elements, 0 bytes
28 * check-output-end