blob: efd2d48332a2ac17e5af6ecdecb26b4a291bad03 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Ensure constant propagation of remainder instructions is working correctly.
2
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00003; RUN: opt < %s -constprop -die -S | not grep rem
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00005define i32 @test1() {
6 %R = srem i32 4, 3 ; <i32> [#uses=1]
7 ret i32 %R
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008}
9
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000010define i32 @test2() {
11 %R = srem i32 123, -23 ; <i32> [#uses=1]
12 ret i32 %R
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013}
14
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000015define float @test3() {
16 %R = frem float 0x4028E66660000000, 0x405ECDA1C0000000 ; <float> [#uses=1]
17 ret float %R
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}
19
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000020define double @test4() {
21 %R = frem double 0x4073833BEE07AFF8, 0x4028AAABB2A0D19C ; <double> [#uses=1]
22 ret double %R
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023}
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000024