main
test-branch
|
Last change
on this file since 397ae5f 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:
544 bytes
|
| Line | |
|---|
| 1 | #include <assert.h>
|
|---|
| 2 | int main() {
|
|---|
| 3 | int x = 5;
|
|---|
| 4 | int y = x + 5;
|
|---|
| 5 | int z = x + y + 5;
|
|---|
| 6 | int result;
|
|---|
| 7 |
|
|---|
| 8 | // branch test:
|
|---|
| 9 | if (x == 5 && y > x)
|
|---|
| 10 | if (y == 10 && z > y)
|
|---|
| 11 | result = 5;
|
|---|
| 12 | else if (x > 0 || x < 10)
|
|---|
| 13 | x = y - 5;
|
|---|
| 14 | else
|
|---|
| 15 | x = 0;
|
|---|
| 16 | assert(result == 5);
|
|---|
| 17 |
|
|---|
| 18 | // trivil loop tests
|
|---|
| 19 | for (int i = 0; i < x && i < y; i++) {
|
|---|
| 20 | result++;
|
|---|
| 21 | }
|
|---|
| 22 | assert(result == 10);
|
|---|
| 23 |
|
|---|
| 24 | while (y < z && x < y)
|
|---|
| 25 | x = 20;
|
|---|
| 26 |
|
|---|
| 27 | do { x = 0; if (x <0 || x == 0) continue; x = 20;} while (y < z && x >= y);
|
|---|
| 28 |
|
|---|
| 29 | return 1;
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.