about summary refs log tree commit diff homepage
path: root/test/Feature/StackTraceOutput.c
blob: d28cb13c1795776b3ae5af5c6ca3f140e9182b89 (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 -g -c -fdiscard-value-names -o %t.bc
// RUN: rm -rf %t.klee-out-d
// RUN: %klee --output-dir=%t.klee-out-d %t.bc
// RUN: FileCheck -input-file=%t.klee-out-d/test000001.assert.err -check-prefix=CHECK-DISCARD %s

// RUN: %clang %s -emit-llvm %O0opt -g -c -fno-discard-value-names -o %t.bc
// RUN: rm -rf %t.klee-out-n
// RUN: %klee --output-dir=%t.klee-out-n %t.bc
// RUN: FileCheck -input-file=%t.klee-out-n/test000001.assert.err -check-prefix=CHECK-NODISCARD %s

#include "klee/klee.h"

#include <assert.h>

void foo(int i, int k) {
  ++i;
  ++k;

  // CHECK-DISCARD: {{.*}} in foo(symbolic, 12) at {{.*}}.c:[[@LINE+2]]
  // CHECK-NODISCARD: {{.*}} in foo(i=symbolic, k=12) at {{.*}}.c:[[@LINE+1]]
  assert(0);
}

int main(void) {
  int i, k = 12;
  klee_make_symbolic(&i, sizeof(i), "i");

  // CHECK-DISCARD: {{.*}} in main() at {{.*}}.c:[[@LINE+2]]
  // CHECK-NODISCARD: {{.*}} in main() at {{.*}}.c:[[@LINE+1]]
  foo(i, k);
}