about summary refs log tree commit diff homepage
path: root/test/Runtime/POSIX/TestMain.c
blob: 79630fa07bb10d7b975f424d2d406d8c09f826d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Run applications with the posix environment but without additional arguments argc, argv for main
// RUN: %llvmgcc -DMAIN1 %s -emit-llvm %O0opt -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 %O0opt -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