about summary refs log tree commit diff homepage
path: root/test/Feature/EntryPointUclibcPosix.c
blob: e3d809285497a94aa42ca68ba6d83fb34d98ea45 (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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// REQUIRES: uclibc
// REQUIRES: posix-runtime

/* Similar test as EntryPoint.c, but with POSIX and uclibc.  This
   checks that the various wrappers and renames introduced when
   linking the uclibc and the POSIX runtime are correctly handled. */

// RUN: %clang -emit-llvm -g -c %s -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --libc=uclibc --posix-runtime --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s

// RUN: rm -rf %t.klee-out
// RUN: %clang -emit-llvm -g -c -DMAIN %s -o %t.bc
// RUN: %klee --libc=uclibc --posix-runtime --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s

// RUN: %clang -emit-llvm -g -c %s -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --libc=uclibc --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s

// RUN: rm -rf %t.klee-out
// RUN: %clang -emit-llvm -g -c -DMAIN %s -o %t.bc
// RUN: %klee --libc=uclibc  --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s

// RUN: %clang -emit-llvm -g -c %s -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --posix-runtime --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s

// RUN: rm -rf %t.klee-out
// RUN: %clang -emit-llvm -g -c -DMAIN %s -o %t.bc
// RUN: %klee --posix-runtime --output-dir=%t.klee-out --entry-point=other_main %t.bc | FileCheck %s


#include <stdio.h>

int other_main() {
  printf("Hello World\n");
  // CHECK: Hello World
  return 0;
}

#ifdef MAIN
int main() {
  return 0;
}
#endif