1 ;RUN: llc -march=sparc < %s | FileCheck %s
2 ;RUN: llc -march=sparc -O0 < %s | FileCheck %s -check-prefix=UNOPT
5 define i32 @test(i32 %a) nounwind {
12 %0 = tail call i32 @bar(i32 %a) nounwind
16 define i32 @test_jmpl(i32 (i32, i32)* nocapture %f, i32 %a, i32 %b) nounwind {
23 %0 = tail call i32 %f(i32 %a, i32 %b) nounwind
27 define i32 @test_loop(i32 %a, i32 %b) nounwind readnone {
30 %0 = icmp sgt i32 %b, 0
31 br i1 %0, label %bb, label %bb5
33 bb: ; preds = %entry, %bb
34 %a_addr.18 = phi i32 [ %a_addr.0, %bb ], [ %a, %entry ]
35 %1 = phi i32 [ %3, %bb ], [ 0, %entry ]
36 %tmp9 = mul i32 %1, %b
39 %.pn = shl i32 %tmp9, %tmp
40 %a_addr.0 = add i32 %.pn, %a_addr.18
41 %3 = add nsw i32 %1, 1
42 %exitcond = icmp eq i32 %3, %b
46 br i1 %exitcond, label %bb5, label %bb
48 bb5: ; preds = %bb, %entry
49 %a_addr.1.lcssa = phi i32 [ %a, %entry ], [ %a_addr.0, %bb ]
52 ret i32 %a_addr.1.lcssa
55 define i32 @test_inlineasm(i32 %a) nounwind {
57 ;CHECK: test_inlineasm
63 tail call void asm sideeffect "sethi 0, %g0", ""() nounwind
64 %0 = icmp slt i32 %a, 0
65 br i1 %0, label %bb, label %bb1
68 %1 = tail call i32 (...)* @foo(i32 %a) nounwind
72 %2 = tail call i32 @bar(i32 %a) nounwind
81 define i32 @test_implicit_def() nounwind {
83 ;UNOPT: test_implicit_def
86 %0 = tail call i32 @func(i32* undef) nounwind
90 declare i32 @func(i32*)