diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/regression/2018-10-01-double-segfault.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/regression/2018-10-01-double-segfault.c b/test/regression/2018-10-01-double-segfault.c new file mode 100644 index 00000000..0fa10e8b --- /dev/null +++ b/test/regression/2018-10-01-double-segfault.c @@ -0,0 +1,27 @@ +// REQUIRES: not-asan +// RUN: %llvmgcc %s -emit-llvm -O0 -g -c -o %t.bc +// RUN: rm -rf %t.klee-out +// RUN: %klee -output-dir=%t.klee-out %t.bc 2>&1 | FileCheck %s +// CHECK: failed external call: strdup +// CHECK: failed external call: strdup + +// objective: check handling of more than one failing external call + + +#include "klee/klee.h" + +#include <stdbool.h> +#include <string.h> + +int main(int argc, char * argv[]) { + bool b; + klee_make_symbolic(&b, sizeof(bool), "b"); + + char * s0; + if (b) { + s0 = strdup((char *) 0xdeadbeef); + } else { + s0 = strdup((void *) 0xdeafbee5); + } + (void) s0; +} |