summaryrefslogtreecommitdiff
path: root/test/Feature
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-11 21:25:10 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-11 21:25:10 +0000
commit6a126513fc82c5871d0785cc5fc9c89ce8c9055d (patch)
tree3ee61a358a0ee1a1814427ff591833305210f660 /test/Feature
parent711679e21c50c62e3ab77977fa13a34d8bd22489 (diff)
downloadllvm-6a126513fc82c5871d0785cc5fc9c89ce8c9055d.tar.gz
llvm-6a126513fc82c5871d0785cc5fc9c89ce8c9055d.tar.bz2
llvm-6a126513fc82c5871d0785cc5fc9c89ce8c9055d.tar.xz
Add a test for constant folding of bitcast to/from floating point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r--test/Feature/fold-fpcast.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Feature/fold-fpcast.ll b/test/Feature/fold-fpcast.ll
new file mode 100644
index 0000000000..cb93ef8c82
--- /dev/null
+++ b/test/Feature/fold-fpcast.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llvm-dis | not grep bitcast
+
+int %test1() {
+ ret int bitcast(float 3.7 to int)
+}
+
+float %test2() {
+ ret float bitcast(int 17 to float)
+}
+
+long %test3() {
+ ret long bitcast (double 3.1415926 to long)
+}
+
+double %test4() {
+ ret double bitcast (long 42 to double)
+}
+