about summary refs log tree commit diff homepage
path: root/test/Runtime/klee-libc/bcmp.c
blob: d0f5d7e59e4cf5a92c5d93c13fb3c10dd1a1536e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out --exit-on-error --libc=klee %t1.bc

// test bcmp for sizes including zero

#include <assert.h>
#include <stdlib.h>
#include <strings.h>

int main() {
  for (int i = 0; i < 5; ++i) {
    void *s = malloc(i);
    if (s) {
      klee_make_symbolic(s, i, "s");
      assert(0 == bcmp(s, s, i));
      free(s);
    }
  }
  return 0;
}