about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2018-11-02 14:49:03 +0000
committerMartinNowack <martin.nowack@gmail.com>2018-11-02 16:39:47 +0000
commit36a9acc3880861842cc6a9da11dd872e36ed19cb (patch)
tree4643fd3cb3e993f0e3fa49d113de644f330d77d6
parentf621d52fb1d58efa061e18d1e356c2cd7c4fa8ea (diff)
downloadklee-36a9acc3880861842cc6a9da11dd872e36ed19cb.tar.gz
Added test for the case where external calls are encountered but disallowed
-rw-r--r--test/Feature/NoExternalCallsAllowed.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Feature/NoExternalCallsAllowed.c b/test/Feature/NoExternalCallsAllowed.c
new file mode 100644
index 00000000..a0886121
--- /dev/null
+++ b/test/Feature/NoExternalCallsAllowed.c
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc %s -emit-llvm %O0opt -c -g -o %t1.bc
+// RUN: rm -rf %t.klee-out
+// RUN: %klee --output-dir=%t.klee-out --external-calls=none %t1.bc 2>&1 | FileCheck %s
+// RUN: test %t.klee-out/test000001.user.err
+
+#include <stdio.h>
+
+int main(int argc, char** argv) {
+  // CHECK: Disallowed call to external function: abs
+  int x = abs(argc);
+  printf("%d\n", argc);
+  return 0;
+}