blob: c4afb63531b1f06bbb1295e2ef2d37ba130293e1 [file] [log] [blame]
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +00001; RUN: llvm-as < %s | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1 -f
3; RUN: grep stfiwx %t1
4; RUN: not grep r1 %t1
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +00005; RUN: llvm-as < %s | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \
7; RUN: -o %t2 -f
8; RUN: not grep stfiwx %t2
9; RUN: grep r1 %t2
10
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +000011define void @test(float %a, i32* %b) {
12 %tmp.2 = fptosi float %a to i32 ; <i32> [#uses=1]
13 store i32 %tmp.2, i32* %b
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014 ret void
15}
16
Tanya Lattner5ebaf3b2008-02-19 08:07:33 +000017define void @test2(float %a, i32* %b, i32 %i) {
18 %tmp.2 = getelementptr i32* %b, i32 1 ; <i32*> [#uses=1]
19 %tmp.5 = getelementptr i32* %b, i32 %i ; <i32*> [#uses=1]
20 %tmp.7 = fptosi float %a to i32 ; <i32> [#uses=3]
21 store i32 %tmp.7, i32* %tmp.5
22 store i32 %tmp.7, i32* %tmp.2
23 store i32 %tmp.7, i32* %b
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024 ret void
25}
26