diff options
author | Paul Marinescu <paul.marinescu@imperial.ac.uk> | 2013-08-29 15:59:16 +0100 |
---|---|---|
committer | Paul Marinescu <paul.marinescu@imperial.ac.uk> | 2013-08-29 15:59:16 +0100 |
commit | b6939ec17b8341b3e0c9b56475e5986750380991 (patch) | |
tree | c44ae0525b1fc3ed752d235e9921d7548f65769a /test/Runtime/POSIX/Openat.c | |
parent | 821b6f6473334eaa6c78205603faf14a2c1aca41 (diff) | |
download | klee-b6939ec17b8341b3e0c9b56475e5986750380991.tar.gz |
Added some of the common *at functions to the model
Diffstat (limited to 'test/Runtime/POSIX/Openat.c')
-rw-r--r-- | test/Runtime/POSIX/Openat.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/Openat.c b/test/Runtime/POSIX/Openat.c new file mode 100644 index 00000000..d417ee47 --- /dev/null +++ b/test/Runtime/POSIX/Openat.c @@ -0,0 +1,18 @@ +// RUN: %llvmgcc %s -emit-llvm -O0 -c -o %t2.bc +// RUN: %klee --posix-runtime --exit-on-error %t2.bc --sym-files 1 10 +// RUN: test -f klee-last/test000001.ktest + +#include <assert.h> +#include <fcntl.h> + +int main(int argc, char **argv) { + int fd = openat(AT_FDCWD, "A", O_RDWR|O_TRUNC); + if (fd != -1) { + char buf[10]; + assert(read(fd, buf, 10) == 10); + assert(klee_is_symbolic(buf[0])); + } else { + klee_silent_exit(0); + } + return 0; +} |