about summary refs log tree commit diff homepage
path: root/test/Feature/AliasFunctionExit.c
blob: 1f863de1f26a996e1fa6a40dc6e803554d14a9cb (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
// RUN: %clang %s -emit-llvm %O0opt -c -o %t1.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out %t1.bc > %t1.log
// RUN: grep -c START %t1.log | grep 1
// RUN: grep -c END %t1.log | grep 2

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void start(int x) {
  printf("START\n");
  if (x == 53)
    exit(1);
}

void __attribute__ ((noinline)) end(int status) {
  klee_alias_function("exit", "exit");
  printf("END: status = %d\n", status);
  exit(status);
}


int main() {
  int x;
  klee_make_symbolic(&x, sizeof(x), "x");

  klee_alias_function("exit", "end");
  start(x);
  end(0);
}