Add a test for constant folding of bitcast to/from floating point.
authorReid Spencer <rspencer@reidspencer.com>
Mon, 11 Dec 2006 21:25:10 +0000 (21:25 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 11 Dec 2006 21:25:10 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32446 91177308-0d34-0410-b5e6-96231b3b80d8

test/Feature/fold-fpcast.ll [new file with mode: 0644]

diff --git a/test/Feature/fold-fpcast.ll b/test/Feature/fold-fpcast.ll
new file mode 100644 (file)
index 0000000..cb93ef8
--- /dev/null
@@ -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)
+}
+