about summary refs log tree commit diff homepage
path: root/test/Feature/BFSSearcherAndDFSSearcherInterleaved.c
blob: 88d49548cf51d1018cd2a3ed36d1df1470f0e71d (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
// RUN: %clang %s -emit-llvm -g -c -o %t.bc
// RUN: rm -rf %t-bfs.klee-out
// RUN: rm -rf %t-dfs.klee-out
// RUN: rm -rf %t-bfs-dfs.klee-out
// RUN: rm -rf %t-dfs-bfs.klee-out
// RUN: %klee -output-dir=%t-bfs.klee-out -search=bfs %t.bc >%t-bfs.out
// RUN: %klee -output-dir=%t-dfs.klee-out -search=dfs %t.bc >%t-dfs.out
// RUN: %klee -output-dir=%t-bfs-dfs.klee-out -search=bfs -search=dfs %t.bc >%t-bfs-dfs.out
// RUN: %klee -output-dir=%t-dfs-bfs.klee-out -search=dfs -search=bfs %t.bc >%t-dfs-bfs.out
// RUN: FileCheck -input-file=%t-bfs.out %s
// RUN: FileCheck -input-file=%t-dfs.out %s
// RUN: FileCheck -input-file=%t-bfs-dfs.out %s
// RUN: FileCheck -input-file=%t-dfs-bfs.out %s

#include "klee/klee.h"

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

  if (x == 1) {
    if (y == 1) {
      if (z == 1) {
        printf("A");
      } else {
        printf("B");
      }
    }
  } else {
    if (y == 1) {
      if (z == 1) {
        printf("C");
      } else {
        printf("D");
      }
    }
  }

  // exactly 4 characters, each of A, B, C and D occur exactly once
  // CHECK: {{^(ABCD|ABDC|ACBD|ACDB|ADBC|ADCB|BACD|BADC|BCAD|BCDA|BDAC|BDCA|CABD|CADB|CBAD|CBDA|CDAB|CDBA|DABC|DACB|DBAC|DBCA|DCAB|DCBA)$}}
}