forked from klee/klee
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMinimizeSize.c
More file actions
27 lines (23 loc) · 893 Bytes
/
MinimizeSize.c
File metadata and controls
27 lines (23 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %clang %s -g -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out --check-out-of-memory --use-sym-size-alloc --use-merged-pointer-dereference=true --symbolic-allocation-threshold=0 %t1.bc >%t.log 2>&1
// RUN: %ktest-tool %t.klee-out/test*.ktest >>%t.log
// RUN: FileCheck %s -input-file=%t.log
#include "klee/klee.h"
#include <stdlib.h>
int main() {
int n = klee_int("n");
if (n >= 3 && n != 4) {
char *storage = (char *)malloc(n);
storage[0] = 'a';
storage[1] = 'b';
storage[2] = 'c';
// CHECK-DAG: MinimizeSize.c:[[@LINE+1]]: memory error: out of bound pointer
storage[3] = 'd';
}
}
// CHECK-DAG: KLEE: done: completed paths = 2
// CHECK-DAG: KLEE: done: partially completed paths = 2
// CHECK-DAG: KLEE: done: generated tests = 4
// Check that exists at least one test with size = 5
// CHECK-DAG: int: 5