brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 34bf5d0 Raw
53 lines · plain
1; RUN: llc < %s -mtriple=mipsel -relocation-model=pic | FileCheck %s2 3@caller.sf1 = internal unnamed_addr global ptr null, align 44@gf1 = external global ptr5@.str = private unnamed_addr constant [3 x i8] c"f2\00"6 7define i32 @main(i32 %argc, ptr nocapture %argv) nounwind {8entry:9; CHECK: lw $[[R0:[0-9]+]], %got(f2)10; CHECK: addiu $25, $[[R0]], %lo(f2)11  tail call fastcc void @f2()12  ret i32 013}14 15define void @caller(i32 %a0, i32 %a1) nounwind {16entry:17; CHECK: lw  $[[R1:[0-9]+]], %got(caller.sf1)18; CHECK: lw  $25, %lo(caller.sf1)($[[R1]])19  %tobool = icmp eq i32 %a1, 020  br i1 %tobool, label %if.end, label %if.then21 22if.then:                                          ; preds = %entry23  %tmp1 = load ptr, ptr @caller.sf1, align 424  tail call void (...) %tmp1() nounwind25  br label %if.end26 27if.end:                                           ; preds = %entry, %if.then28; CHECK: lw  $[[R2:[0-9]+]], %got(sf2)29; CHECK: addiu ${{[0-9]+}}, $[[R2]], %lo(sf2)30; CHECK: lw  $[[R3:[0-9]+]], %got(caller.sf1)31; CHECK: sw  ${{[0-9]+}}, %lo(caller.sf1)($[[R3]])32  %tobool3 = icmp ne i32 %a0, 033  %tmp4 = load ptr, ptr @gf1, align 434  %cond = select i1 %tobool3, ptr %tmp4, ptr @sf235  store ptr %cond, ptr @caller.sf1, align 436  ret void37}38 39define internal void @sf2() nounwind {40entry:41  %call = tail call i32 (ptr, ...) @printf(ptr @.str) nounwind42  ret void43}44 45declare i32 @printf(ptr nocapture, ...) nounwind46 47define internal fastcc void @f2() nounwind noinline {48entry:49  %call = tail call i32 (ptr, ...) @printf(ptr @.str) nounwind50  ret void51}52 53