blob: 1ad558c6abc964b5cf9af65499852e1d215de08b [file] [log] [blame]
Dan Gohmanb7c0b242009-09-11 18:36:27 +00001; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx -o %t1
Reid Spencereb1d74e2007-04-16 17:36:08 +00002; RUN: grep stfiwx %t1
3; RUN: not grep r1 %t1
Dan Gohmanb7c0b242009-09-11 18:36:27 +00004; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx \
Dan Gohmanfea1dd02009-08-25 15:38:29 +00005; RUN: -o %t2
Reid Spencereb1d74e2007-04-16 17:36:08 +00006; RUN: not grep stfiwx %t2
7; RUN: grep r1 %t2
Chris Lattnerc607fa82006-03-01 05:49:05 +00008
Chris Lattner261bc892010-11-14 22:22:14 +00009define void @test(float %a, i32* %b) nounwind {
Tanya Lattnercfab3da2008-02-19 08:07:33 +000010 %tmp.2 = fptosi float %a to i32 ; <i32> [#uses=1]
11 store i32 %tmp.2, i32* %b
Chris Lattnerc607fa82006-03-01 05:49:05 +000012 ret void
13}
14
Chris Lattner261bc892010-11-14 22:22:14 +000015define void @test2(float %a, i32* %b, i32 %i) nounwind {
Tanya Lattnercfab3da2008-02-19 08:07:33 +000016 %tmp.2 = getelementptr i32* %b, i32 1 ; <i32*> [#uses=1]
17 %tmp.5 = getelementptr i32* %b, i32 %i ; <i32*> [#uses=1]
18 %tmp.7 = fptosi float %a to i32 ; <i32> [#uses=3]
19 store i32 %tmp.7, i32* %tmp.5
20 store i32 %tmp.7, i32* %tmp.2
21 store i32 %tmp.7, i32* %b
Chris Lattnerc607fa82006-03-01 05:49:05 +000022 ret void
23}
24