about summary refs log tree commit diff homepage
path: root/test/regression/2015-08-30-empty-constraints.c
blob: 8598b6ae92fd97d2eeb5d8a0c989418d143263e8 (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: %clang %s -emit-llvm -g %O0opt -c -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --output-dir=%t.klee-out %t.bc 2> %t.log
// RUN: FileCheck -input-file=%t.log %s

/**
 * This test generates one execution state without constraints.
 *
 * The state gets terminated (in this case return) and initial values
 * are generated.
 * Make sure we are able to generate an input.
 */
#include "klee/klee.h"
int main() {
  int d;

  klee_make_symbolic(&d, sizeof(d), "d");

  // CHECK-NOT: unable to compute initial values (invalid constraints?)!
  if ((d & 2) / 4)
    return 1;
  return 0;
}