about summary refs log tree commit diff homepage
path: root/test/regression/2018-10-01-double-segfault.c
blob: 1402c07b0d4185c8409af7b8528ac627a6d4973c (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
// REQUIRES: not-asan
// RUN: %clang %s -emit-llvm %O0opt -g -c -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee -output-dir=%t.klee-out %t.bc 2>&1 | FileCheck %s
// CHECK: failed external call: strdup
// CHECK: failed external call: strdup

// objective: check handling of more than one failing external call


#include "klee/klee.h"

#include <stdbool.h>
#include <string.h>

int main(int argc, char * argv[]) {
  bool b;
  klee_make_symbolic(&b, sizeof(bool), "b");

  char * s0;
  if (b) {
    s0 = strdup((char *) 0xdeadbeef);
  } else {
    s0 = strdup((void *) 0xdeafbee5);
  }
  (void) s0;
}