blob: 09ca8f469336cd98a45eb8413458ec9628af2e85 (
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: %llvmgcc %s -emit-llvm -O0 -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);
}
|