blob: ac9509d5f4ef9d5bfcb6d5ec15acdc63fb724bd6 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Ensure constant propagation of remainder instructions is working correctly.
2
Dan Gohman1b4c27772009-09-08 16:50:01 +00003; RUN: opt %s -constprop -die | llvm-dis | 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