1 ; RUN: llc -march=mips < %s | FileCheck %s -check-prefix=O32 2 ; RUN: llc -march=mips -regalloc=basic < %s | FileCheck %s -check-prefix=O32 3 ; RUN: llc -march=mips64el -mcpu=mips64 -mattr=n64 < %s | FileCheck %s -check-prefix=N64 4 5 @i1 = global [3 x i32] [i32 1, i32 2, i32 3], align 4 6 @i3 = common global i32* null, align 4 7 8 ; O32: lw ${{[0-9]+}}, %got(i3)($gp) 9 ; O32: addiu ${{[0-9]+}}, $gp, %got(i1) 10 ; N64: ld ${{[0-9]+}}, %got_disp(i3)($gp) 11 ; N64: daddiu ${{[0-9]+}}, $gp, %got_disp(i1) 12 define i32* @cmov1(i32 %s) nounwind readonly { 13 entry: 14 %tobool = icmp ne i32 %s, 0 15 %tmp1 = load i32** @i3, align 4 16 %cond = select i1 %tobool, i32* getelementptr inbounds ([3 x i32]* @i1, i32 0, i32 0), i32* %tmp1 17 ret i32* %cond 18 } 19 20 @c = global i32 1, align 4 21 @d = global i32 0, align 4 22 23 ; O32: cmov2: 24 ; O32: addiu $[[R1:[0-9]+]], $gp, %got(d) 25 ; O32: addiu $[[R0:[0-9]+]], $gp, %got(c) 26 ; O32: movn $[[R1]], $[[R0]], ${{[0-9]+}} 27 ; N64: cmov2: 28 ; N64: daddiu $[[R1:[0-9]+]], $gp, %got_disp(d) 29 ; N64: daddiu $[[R0:[0-9]+]], $gp, %got_disp(c) 30 ; N64: movn $[[R1]], $[[R0]], ${{[0-9]+}} 31 define i32 @cmov2(i32 %s) nounwind readonly { 32 entry: 33 %tobool = icmp ne i32 %s, 0 34 %tmp1 = load i32* @c, align 4 35 %tmp2 = load i32* @d, align 4 36 %cond = select i1 %tobool, i32 %tmp1, i32 %tmp2 37 ret i32 %cond 38 } 39 40