Пример #1
0
int* recv()
{
  if (klee_int("received_pred")) {
    pkt = klee_int("received_val");
    return &pkt;
  }
  return 0;
}
int main() {
  int a[3];/*
  klee_make_symbolic(&a[0], sizeof(a[0]), "a[0]");
  klee_make_symbolic(&a[1], sizeof(a[1]), "a[1]");
  klee_make_symbolic(&a[2], sizeof(a[2]), "a[2]");*/
  a[0] = klee_int("a0");
  a[1] = klee_int("a1");
  a[2] = klee_int("a2");
  return get_sign(a);
}
Пример #3
0
/**
   ???

   @params list ???
*/
void make_symbolic(list_t * list) 
{
#ifdef KLEE
  uint64_t x = klee_int("testint");
  *(uint64_t *)list->arr = x;
#endif
}
Пример #4
0
int main() {
  assert(klee_int("assert"));

  while (1) {
  }

  return 0;
}
Пример #5
0
int main() {
  int x = klee_int("x");
  klee_assume(x > 10);
  klee_assume(x < 20);

  assert(!klee_is_symbolic(klee_get_value_i32(x)));
  assert(klee_get_value_i32(x) > 10);
  assert(klee_get_value_i32(x) < 20);

  return 0;
}
Пример #6
0
int main(int argc, char *argv[]) {

  char str[MAXSTR];
  int offset;

  klee_make_symbolic(str, MAXSTR, "str");
  offset = klee_int("offset");

  /* With the following two assumes, only two paths are traversed. */
  
  /* klee_assume(offset >= 0); */
  /* klee_assume(offset < MAXSTR); */

  int result = test(str, offset);

  return result;
}