fix rdar://9289583 - fast isel should handle non-canonical commutative binops
[oota-llvm.git] / test / Transforms / ConstProp / remtest.ll
index eb61a14eaaec4d42eabf92679586316682bfd723..efd2d48332a2ac17e5af6ecdecb26b4a291bad03 100644 (file)
@@ -1,17 +1,24 @@
-; Ensure constant propogation of remainder instructions is working correctly.
+; Ensure constant propagation of remainder instructions is working correctly.
 
-; RUN: if as < %s | opt -constprop | dis | grep rem
-; RUN: then exit 1
-; RUN: else exit 0
-; RUN: fi
+; RUN: opt < %s -constprop -die -S | not grep rem
 
-int "test1"() {
-       %R = rem int 4, 3
-       ret int %R
+define i32 @test1() {
+        %R = srem i32 4, 3              ; <i32> [#uses=1]
+        ret i32 %R
 }
 
-int "test2"() {
-       %R = rem int 123, -23
-       ret int %R
+define i32 @test2() {
+        %R = srem i32 123, -23          ; <i32> [#uses=1]
+        ret i32 %R
+}
+
+define float @test3() {
+        %R = frem float 0x4028E66660000000, 0x405ECDA1C0000000          ; <float> [#uses=1]
+        ret float %R
+}
+
+define double @test4() {
+        %R = frem double 0x4073833BEE07AFF8, 0x4028AAABB2A0D19C         ; <double> [#uses=1]
+        ret double %R
 }