56 lines · plain
1; RUN: llc -mtriple=mipsel -mattr=+xgot \2; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=O323; RUN: llc -mtriple=mips64el -mcpu=mips64r2 -mattr=+xgot \4; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=N645; RUN: llc -mtriple=mipsel -mattr=+xgot -fast-isel \6; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=O327; RUN: llc -mtriple=mips64el -mcpu=mips64r2 -mattr=+xgot -fast-isel \8; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=N649 10@v0 = external global i3211 12define void @foo1() nounwind {13entry:14; O32-LABEL: foo1:15; O32: lui $[[R0:[0-9]+]], %got_hi(v0)16; O32: addu $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}}17; O32: lw ${{[0-9]+}}, %got_lo(v0)($[[R1]])18; O32: lui $[[R2:[0-9]+]], %call_hi(foo0)19; O32: addu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}20; O32: lw ${{[0-9]+}}, %call_lo(foo0)($[[R3]])21 22; N64-LABEL: foo1:23; N64-DAG: lui $[[R0:[0-9]+]], %got_hi(v0)24; N64-DAG: daddu $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}}25; N64-DAG: lui $[[R2:[0-9]+]], %call_hi(foo0)26; N64-DAG: daddu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}27; N64-DAG: ld ${{[0-9]+}}, %got_lo(v0)($[[R1]])28; N64-DAG: ld ${{[0-9]+}}, %call_lo(foo0)($[[R3]])29 30 %0 = load i32, ptr @v0, align 431 tail call void @foo0(i32 %0) nounwind32 ret void33}34 35declare void @foo0(i32)36 37; call to external function.38 39define void @foo2(ptr nocapture %d, ptr nocapture %s, i32 %n) nounwind {40entry:41; O32-LABEL: foo2:42; O32: lui $[[R2:[0-9]+]], %call_hi(memcpy)43; O32: addu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}44; O32: lw ${{[0-9]+}}, %call_lo(memcpy)($[[R3]])45 46; N64-LABEL: foo2:47; N64: lui $[[R2:[0-9]+]], %call_hi(memcpy)48; N64: daddu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}}49; N64: ld ${{[0-9]+}}, %call_lo(memcpy)($[[R3]])50 51 tail call void @llvm.memcpy.p0.p0.i32(ptr align 4 %d, ptr align 4 %s, i32 %n, i1 false)52 ret void53}54 55declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind56