about summary refs log tree commit diff homepage
path: root/test/regression/2017-02-21-pathOS-id.c
blob: 112875de098d579f60378f4834227c6799617832 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang %s -emit-llvm -g %O0opt -c -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out -write-paths %t.bc 2> %t.log
// RUN: cat %t.klee-out/test000001.path | wc -l | grep -q 1
// RUN: cat %t.klee-out/test000002.path | wc -l | grep -q 1
// RUN: cat %t.klee-out/test000003.path | wc -l | grep -q 1
// RUN: cat %t.klee-out/test000004.path | wc -l | grep -q 1

#include "klee/klee.h"
#include "stdlib.h"
int main(){
	int a, b;
	klee_make_symbolic (&a, sizeof(int), "a");
	klee_make_symbolic (&b, sizeof(int), "b");
	klee_assume(a<2);
	klee_assume(a>=0);
	malloc(a);
	if(b){
		b++;//do something
	}
	return b;
}