source: CIVL/examples/focus/sv-benchmarks-main-c-array-industry-pattern/c/array-industry-pattern/original/array_mul_init.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 566 bytes
Line 
1extern void abort(void);
2#include <assert.h>
3void reach_error() { assert(0); }
4void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: {reach_error();abort();} } }
5#define SIZE 100000
6short __VERIFIER_nondet_short();
7int main()
8{
9 int a[SIZE];
10 int b[SIZE];
11 int k;
12 int i;
13
14 for (i = 0; i<SIZE ; i++)
15 {
16 a[i] = i;
17 b[i] = i ;
18 }
19
20 for (i=0; i< SIZE; i++)
21 {
22 if(__VERIFIER_nondet_short())
23 {
24 k = __VERIFIER_nondet_short();
25 a[i] = k;
26 b[i] = k * k ;
27 }
28 }
29
30 for (i=0; i< SIZE; i++)
31 {
32 __VERIFIER_assert(a[i] == b[i] || b[i] == a[i] * a[i]);
33 }
34}
35
Note: See TracBrowser for help on using the repository browser.