about summary refs log tree commit diff homepage
path: root/test/Intrinsics/IsConstant.ll
blob: b196d9331c496053f99faec476772c226a088135 (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
; REQUIRES: geq-llvm-8.0
; RUN: %llvmas %s -o=%t.bc
; RUN: rm -rf %t.klee-out
; RUN: %klee -exit-on-error --output-dir=%t.klee-out --optimize=false %t.bc

declare i1 @llvm.is.constant.i32(i32)

declare i32 @klee_is_symbolic(i32)
declare void @klee_abort(i8*)

define i1 @check1() {
  %r = call i1 @llvm.is.constant.i32(i32 123)

  ret i1 %r
}

define i1 @check2() {
  %x = call i32 @klee_is_symbolic(i32 0)

  %r = call i1 @llvm.is.constant.i32(i32 %x)

  %notR = xor i1 %r, 1

  ret i1 %notR
}

define i32 @main() {
  %r1 = call i1 @check1()
  %r2 = call i1 @check2()

  br i1 %r1, label %next, label %exitFalse
next:
  br i1 %r2, label %exitTrue, label %exitFalse
exitFalse:
  call void @klee_abort(i8* null)
  ret i32 1
exitTrue:
  ret i32 0
}