diff options
author | Martin Nowack <m.nowack@imperial.ac.uk> | 2018-09-06 11:54:25 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-09-10 15:24:17 +0100 |
commit | c97526d0fff13e098b284369e2fc40c256b268d5 (patch) | |
tree | 281aea1f6e99bff0c80ee7d2c18dca0fc4725495 /test | |
parent | 57607f5075dd9ba1e058a05ad84d6359f799fe6a (diff) | |
download | klee-c97526d0fff13e098b284369e2fc40c256b268d5.tar.gz |
Add testcase to run POSIX environment and main without arguments
Diffstat (limited to 'test')
-rw-r--r-- | test/Runtime/POSIX/TestMain.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/TestMain.c b/test/Runtime/POSIX/TestMain.c new file mode 100644 index 00000000..c91d4e36 --- /dev/null +++ b/test/Runtime/POSIX/TestMain.c @@ -0,0 +1,23 @@ +// Run applications with the posix environment but without additional arguments argc, argv for main +// RUN: %llvmgcc -DMAIN1 %s -emit-llvm -O0 -c -g -o %t.bc +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime %t.bc | FileCheck %s -check-prefix=CHECK-MAIN1 +// RUN: %llvmgcc -DMAIN2 %s -emit-llvm -O0 -c -g -o %t.bc +// RUN: rm -rf %t.klee-out +// RUN: %klee --output-dir=%t.klee-out --posix-runtime %t.bc | FileCheck %s -check-prefix=CHECK-MAIN2 +#ifdef MAIN1 +#include <stdio.h> +int main() { + printf("Execute main1\n"); + // CHECK-MAIN1: Execute main1 + return 0; +} +#endif +#ifdef MAIN2 +#include <stdio.h> +int main(void) { + printf("Execute main2\n"); + // CHECK-MAIN2: Execute main2 + return 0; +} +#endif |