diff options
author | Cristian Cadar <cristic@cs.stanford.edu> | 2011-09-27 11:08:04 +0000 |
---|---|---|
committer | Cristian Cadar <cristic@cs.stanford.edu> | 2011-09-27 11:08:04 +0000 |
commit | d151d06a875cbbaa0696e3c2d58158c2e2195995 (patch) | |
tree | 2349cbde83a0f35757bdf82d615d3bb13f740f1e /examples | |
parent | 9702b978795d8e0518e211bc0a3789363157fb16 (diff) | |
download | klee-d151d06a875cbbaa0696e3c2d58158c2e2195995.tar.gz |
Changed Tutorial 1, which was causing confusion due to differences in
LLVM code generation before and after LLVM 2.8. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@140602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/get_sign/get_sign.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/get_sign/get_sign.c b/examples/get_sign/get_sign.c new file mode 100644 index 00000000..a97ac375 --- /dev/null +++ b/examples/get_sign/get_sign.c @@ -0,0 +1,20 @@ +/* + * First KLEE tutorial: testing a small function + */ + + +int get_sign(int x) { + if (x == 0) + return 0; + + if (x < 0) + return -1; + else + return 1; +} + +int main() { + int a; + klee_make_symbolic(&a, sizeof(a), "a"); + return get_sign(a); +} |