aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/fpcast.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/fpcast.ll')
-rw-r--r--test/Transforms/InstCombine/fpcast.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fpcast.ll b/test/Transforms/InstCombine/fpcast.ll
new file mode 100644
index 0000000..0c38767
--- /dev/null
+++ b/test/Transforms/InstCombine/fpcast.ll
@@ -0,0 +1,14 @@
+; Test some floating point casting cases
+; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast
+; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
+; RUN: egrep {ret i8 \(-1\)\|\(255\)}
+
+sbyte %test1() {
+ %x = fptoui float 255.0 to sbyte
+ ret sbyte %x
+}
+
+ubyte %test2() {
+ %x = fptosi float -1.0 to ubyte
+ ret ubyte %x
+}