diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-11-21 20:40:38 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-11-21 20:40:38 +0000 |
commit | f09a03776dbbc882c9b15eeccb8ec847058fbfa0 (patch) | |
tree | 1e375dc8665416221e907ce75dddac8867fddc46 /test | |
parent | 238f34a706a60bf9606d70122bac0f77265e3431 (diff) | |
download | llvm-f09a03776dbbc882c9b15eeccb8ec847058fbfa0.tar.gz llvm-f09a03776dbbc882c9b15eeccb8ec847058fbfa0.tar.bz2 llvm-f09a03776dbbc882c9b15eeccb8ec847058fbfa0.tar.xz |
[mips] Generate big GOT code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Mips/biggot.ll | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/biggot.ll b/test/CodeGen/Mips/biggot.ll new file mode 100644 index 0000000000..c4ad851c82 --- /dev/null +++ b/test/CodeGen/Mips/biggot.ll @@ -0,0 +1,50 @@ +; RUN: llc -march=mipsel -mxgot < %s | FileCheck %s -check-prefix=O32 +; RUN: llc -march=mips64el -mcpu=mips64r2 -mattr=+n64 -mxgot < %s | \ +; RUN: FileCheck %s -check-prefix=N64 + +@v0 = external global i32 + +define void @foo1() nounwind { +entry: +; O32: lui $[[R0:[0-9]+]], %got_hi(v0) +; O32: addu $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}} +; O32: lw ${{[0-9]+}}, %got_lo(v0)($[[R1]]) +; O32: lui $[[R2:[0-9]+]], %call_hi(foo0) +; O32: addu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}} +; O32: lw ${{[0-9]+}}, %call_lo(foo0)($[[R3]]) + +; N64: lui $[[R0:[0-9]+]], %got_hi(v0) +; N64: daddu $[[R1:[0-9]+]], $[[R0]], ${{[a-z0-9]+}} +; N64: ld ${{[0-9]+}}, %got_lo(v0)($[[R1]]) +; N64: lui $[[R2:[0-9]+]], %call_hi(foo0) +; N64: daddu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}} +; N64: ld ${{[0-9]+}}, %call_lo(foo0)($[[R3]]) + + %0 = load i32* @v0, align 4 + tail call void @foo0(i32 %0) nounwind + ret void +} + +declare void @foo0(i32) + +; call to external function. + +define void @foo2(i32* nocapture %d, i32* nocapture %s, i32 %n) nounwind { +entry: +; O32: foo2: +; O32: lui $[[R2:[0-9]+]], %call_hi(memcpy) +; O32: addu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}} +; O32: lw ${{[0-9]+}}, %call_lo(memcpy)($[[R3]]) + +; N64: foo2: +; N64: lui $[[R2:[0-9]+]], %call_hi(memcpy) +; N64: daddu $[[R3:[0-9]+]], $[[R2]], ${{[a-z0-9]+}} +; N64: ld ${{[0-9]+}}, %call_lo(memcpy)($[[R3]]) + + %0 = bitcast i32* %d to i8* + %1 = bitcast i32* %s to i8* + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 %n, i32 4, i1 false) + ret void +} + +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind |