blob: c4afb63531b1f06bbb1295e2ef2d37ba130293e1 [file] [log] [blame]
Tanya Lattnercfab3da2008-02-19 08:07:33 +00001; RUN: llvm-as < %s | \
Reid Spencereb1d74e2007-04-16 17:36:08 +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 Lattnercfab3da2008-02-19 08:07:33 +00005; RUN: llvm-as < %s | \
Reid Spencereb1d74e2007-04-16 17:36:08 +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
Chris Lattnerc607fa82006-03-01 05:49:05 +000010
Tanya Lattnercfab3da2008-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
Chris Lattnerc607fa82006-03-01 05:49:05 +000014 ret void
15}
16
Tanya Lattnercfab3da2008-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
Chris Lattnerc607fa82006-03-01 05:49:05 +000024 ret void
25}
26