about summary refs log tree commit diff homepage
path: root/test/Feature/InlineAsm.c
blob: e6da7bb9510902619d0d8d087f1c7b342936981a (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
// RUN: %clang %s -emit-llvm %O0opt -c -g -o %t.bc
// RUN: rm -rf %t.klee-out
// RUN: %klee --external-calls=all --exit-on-error --output-dir=%t.klee-out %t.bc > %t.output.log 2>&1
#include "klee/klee.h"
#include <assert.h>

int main() {

  int x;
  klee_make_symbolic(&x, sizeof(x), "x");
  if (x == 239) {
    __asm__("neg %0"
            : "+r"(x));
    assert(x == -239);
  }

  int y = x;
  __asm__("add $5, %0"
          : "+r"(x));
  __asm__("add $0, %0"
          : "+r"(y));
  assert(x == y + 5);

  return 0;
}