about summary refs log tree commit diff homepage
path: root/test/Runtime/klee-libc/bcmp.c
blob: 1cc72aa189cd42498363398b93daed27cb403707 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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 "klee/klee.h"

#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;
}