From 6ed08c11c6feeabf4749573fdee2e9835d1eb6d2 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Wed, 19 Sep 2018 12:55:26 +0100 Subject: Add checks for correct usage of the POSIX model, together with an associated test. --- test/Runtime/POSIX/Usage.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/Runtime/POSIX/Usage.c (limited to 'test') diff --git a/test/Runtime/POSIX/Usage.c b/test/Runtime/POSIX/Usage.c new file mode 100644 index 00000000..ce338e5c --- /dev/null +++ b/test/Runtime/POSIX/Usage.c @@ -0,0 +1,28 @@ +// This test checks for the (in)correct use of --sym-files and --sym-args + +// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t.bc +// RUN: rm -rf %t.klee-out + +// RUN: not %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-files 1 10 --sym-files 2 10 &> %t1 +// RUN: grep "Multiple --sym-files are not allowed" %t1 +// RUN: rm -rf %t.klee-out + +// RUN: not %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-files 0 10 &> %t2 +// RUN: grep "The first argument to --sym-files (number of files) cannot be 0" %t2 +// RUN: rm -rf %t.klee-out + +// RUN: not %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-files 2 0 &> %t3 +// RUN: grep "The second argument to --sym-files (file size) cannot be 0" %t3 +// RUN: rm -rf %t.klee-out + +// RUN: not %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-args 3 2 10 &> %t4 +// RUN: grep "Invalid range to --sym-args" %t4 +// RUN: rm -rf %t.klee-out + +// RUN: not %klee --output-dir=%t.klee-out --exit-on-error --posix-runtime %t.bc --sym-args 0 0 10 &> %t5 +// RUN: grep "Invalid range to --sym-args" %t5 +// RUN: rm -rf %t.klee-out + +int main(int argc, char** argv) { + return 0; +} -- cgit 1.4.1