Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mips < %s | FileCheck %s
      2 ; RUN: llc -march=mips -regalloc=basic < %s | FileCheck %s
      3 
      4 @i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4
      5 @i3 = common global i32* null, align 4
      6 
      7 ; CHECK:  addiu ${{[0-9]+}}, $gp, %got(i1)
      8 ; CHECK:  lw  ${{[0-9]+}}, %got(i3)($gp)
      9 define i32* @cmov1(i32 %s) nounwind readonly {
     10 entry:
     11   %tobool = icmp ne i32 %s, 0
     12   %tmp1 = load i32** @i3, align 4
     13   %cond = select i1 %tobool, i32* getelementptr inbounds ([3 x i32]* @i1, i32 0, i32 0), i32* %tmp1
     14   ret i32* %cond
     15 }
     16 
     17 @c = global i32 1, align 4
     18 @d = global i32 0, align 4
     19 
     20 ; CHECK: cmov2:
     21 ; CHECK: addiu $[[R0:[0-9]+]], $gp, %got(c)
     22 ; CHECK: addiu $[[R1:[0-9]+]], $gp, %got(d)
     23 ; CHECK: movn  $[[R1]], $[[R0]], ${{[0-9]+}}
     24 define i32 @cmov2(i32 %s) nounwind readonly {
     25 entry:
     26   %tobool = icmp ne i32 %s, 0
     27   %tmp1 = load i32* @c, align 4
     28   %tmp2 = load i32* @d, align 4
     29   %cond = select i1 %tobool, i32 %tmp1, i32 %tmp2
     30   ret i32 %cond
     31 }
     32 
     33