aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2018-10-01 10:33:34 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2019-05-30 09:45:21 +0100
commit4b93a3ecf7514d181730f5a8f8bfe7e086160b4c (patch)
tree50b6509e86f449d6ab2ef8c867c5ff776433c1f3 /test
parentabf654288c2f7f0ee6e1dd3e34b70c1aabe82ea7 (diff)
downloadklee-4b93a3ecf7514d181730f5a8f8bfe7e086160b4c.tar.gz
remove klee_alias_function()
this function can be used to modify the control flow of the program on different paths, enabling self-modifying code.
Diffstat (limited to 'test')
-rw-r--r--test/Feature/AliasFunction.c37
-rw-r--r--test/Feature/AliasFunctionExit.c31
2 files changed, 0 insertions, 68 deletions
diff --git a/test/Feature/AliasFunction.c b/test/Feature/AliasFunction.c
deleted file mode 100644
index 6a5e9174..00000000
--- a/test/Feature/AliasFunction.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
-// RUN: rm -rf %t.klee-out
-// RUN: %klee --output-dir=%t.klee-out %t1.bc > %t1.log
-// RUN: grep -c foo %t1.log | grep 5
-// RUN: grep -c bar %t1.log | grep 4
-
-#include <stdio.h>
-#include <stdlib.h>
-
-void __attribute__ ((noinline)) foo() { printf(" foo()\n"); }
-void __attribute__ ((noinline)) bar() { printf(" bar()\n"); }
-
-int main() {
- int x;
- klee_make_symbolic(&x, sizeof(x), "x");
-
- // call once, so that it is not removed by optimizations
- bar();
-
- // no aliases
- foo();
-
- if (x > 10)
- {
- // foo -> bar
- klee_alias_function("foo", "bar");
-
- if (x > 20)
- foo();
- }
-
- foo();
-
- // undo
- klee_alias_function("foo", "foo");
- foo();
-}
diff --git a/test/Feature/AliasFunctionExit.c b/test/Feature/AliasFunctionExit.c
deleted file mode 100644
index 1f863de1..00000000
--- a/test/Feature/AliasFunctionExit.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
-// RUN: rm -rf %t.klee-out
-// RUN: %klee --output-dir=%t.klee-out %t1.bc > %t1.log
-// RUN: grep -c START %t1.log | grep 1
-// RUN: grep -c END %t1.log | grep 2
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-void start(int x) {
- printf("START\n");
- if (x == 53)
- exit(1);
-}
-
-void __attribute__ ((noinline)) end(int status) {
- klee_alias_function("exit", "exit");
- printf("END: status = %d\n", status);
- exit(status);
-}
-
-
-int main() {
- int x;
- klee_make_symbolic(&x, sizeof(x), "x");
-
- klee_alias_function("exit", "end");
- start(x);
- end(0);
-}