about summary refs log tree commit diff homepage
path: root/test/Intrinsics/abs-overflow.ll
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2021-07-07 10:33:46 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2021-09-10 15:14:56 +0100
commit8775b9cf6c716f51fe90d668e734a1288c8b5404 (patch)
tree5f586ff87b1fddfdebbcc670b658ea0e054c7d41 /test/Intrinsics/abs-overflow.ll
parent3d7c05a7e86a72a4fc8df115591bd1e7a50f9d84 (diff)
downloadklee-8775b9cf6c716f51fe90d668e734a1288c8b5404.tar.gz
llvm12: Implement llvm.abs intrinsic
The vector variants are not implemented at the moment.
See: https://reviews.llvm.org/D84125

Co-authored-by: Lukas Zaoral <lzaoral@redhat.com>
Co-authored-by: Martin Nowack <m.nowack@imperial.ac.uk>
Diffstat (limited to 'test/Intrinsics/abs-overflow.ll')
-rw-r--r--test/Intrinsics/abs-overflow.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Intrinsics/abs-overflow.ll b/test/Intrinsics/abs-overflow.ll
new file mode 100644
index 00000000..33b47ecf
--- /dev/null
+++ b/test/Intrinsics/abs-overflow.ll
@@ -0,0 +1,12 @@
+; REQUIRES: geq-llvm-12.0
+; RUN: rm -rf %t.klee-out
+; RUN: %klee --output-dir=%t.klee-out --optimize=false %s 2> %t.stderr.log
+; RUN: FileCheck %s < %t.stderr.log
+
+define i32 @main() {
+  %1 = call i32 @llvm.abs.i32(i32 -2147483648, i1 true)
+  ; CHECK: llvm.abs called with poison and INT_MIN
+  ret i32 0
+}
+
+declare i32 @llvm.abs.i32(i32, i1 immarg)