about summary refs log tree commit diff homepage
path: root/examples/get_sign/get_sign.c
diff options
context:
space:
mode:
authorCristian Cadar <cristic@cs.stanford.edu>2011-09-27 11:08:04 +0000
committerCristian Cadar <cristic@cs.stanford.edu>2011-09-27 11:08:04 +0000
commitd151d06a875cbbaa0696e3c2d58158c2e2195995 (patch)
tree2349cbde83a0f35757bdf82d615d3bb13f740f1e /examples/get_sign/get_sign.c
parent9702b978795d8e0518e211bc0a3789363157fb16 (diff)
downloadklee-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/get_sign/get_sign.c')
-rw-r--r--examples/get_sign/get_sign.c20
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);
+}