source: CIVL/examples/languageFeatures/calloc.cvl@ 04c71e3

1.23 2.0 main test-branch
Last change on this file since 04c71e3 was 33ccc0c, checked in by Wenhao Wu <wuwenhao@…>, 9 years ago

Change the calloc.cvl example into the simplest version

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@3792 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 306 bytes
Line 
1/* Commandline execution:
2 * civl verify malloc.cvl
3 * */
4#include <civlc.cvh>
5#include <string.h>
6#include <stdlib.h>
7
8void main() {
9 double *p = calloc(5, sizeof(double));
10
11 $assert(p[0]==0.0);
12 $assert(p[1]==0.0);
13 $assert(p[2]==0.0);
14 $assert(p[3]==0.0);
15 $assert(p[4]==0.0);
16 $free(p);
17}
Note: See TracBrowser for help on using the repository browser.