source: CIVL/mods/dev.civl.com/examples/svcomp17/gcd_1_true-unreach-call.i@ cb4d4f4

1.23 2.0 main test-branch
Last change on this file since cb4d4f4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

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

  • Property mode set to 100644
File size: 606 bytes
Line 
1extern void __VERIFIER_error() __attribute__ ((__noreturn__));
2
3extern int __VERIFIER_nondet_int(void);
4void __VERIFIER_assert(int cond) {
5 if (!(cond)) {
6 ERROR: __VERIFIER_error();
7 }
8 return;
9}
10signed char gcd_test(signed char a, signed char b)
11{
12 signed char t;
13
14 if (a < 0) a = -a;
15 if (b < 0) b = -b;
16
17 while (b != 0) {
18 t = b;
19 b = a % b;
20 a = t;
21 }
22 return a;
23}
24
25
26int main()
27{
28 signed char x;
29 signed char y;
30 signed char g;
31
32 if (y > 0 && x % y == 0) {
33 g = gcd_test(x, y);
34
35 __VERIFIER_assert(g == y);
36 }
37
38 return 0;
39}
Note: See TracBrowser for help on using the repository browser.