diff options
| author | Simon Dardis <simon.dardis@imgtec.com> | 2017-07-21 17:19:00 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@imgtec.com> | 2017-07-21 17:19:00 +0000 |
| commit | 0310eb7a675784f5e6472b1f02d69777c2d981a3 (patch) | |
| tree | aa56f67e064e91f13cea53ef1fbe172ccbd28434 /llvm/test/CodeGen | |
| parent | 5f16f54af3974e70f68be58e57d669dd7ebc6882 (diff) | |
| download | bcm5719-llvm-0310eb7a675784f5e6472b1f02d69777c2d981a3.tar.gz bcm5719-llvm-0310eb7a675784f5e6472b1f02d69777c2d981a3.zip | |
[mips] Support -membedded-data and fix a related bug
-membedded-data changes the location of constant data from the .sdata to
the .rodata section. Previously it was (incorrectly) always located in the
.rodata section.
Reviewers: atanasyan
Differential Revision: https://reviews.llvm.org/D35686
llvm-svn: 308758
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/Mips/2008-07-15-SmallSection.ll | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/llvm/test/CodeGen/Mips/2008-07-15-SmallSection.ll b/llvm/test/CodeGen/Mips/2008-07-15-SmallSection.ll index 79f4d7970e6..21495423200 100644 --- a/llvm/test/CodeGen/Mips/2008-07-15-SmallSection.ll +++ b/llvm/test/CodeGen/Mips/2008-07-15-SmallSection.ll @@ -1,16 +1,32 @@ -; RUN: llc < %s -march=mips -mcpu=mips32 -mips-ssection-threshold=8 -relocation-model=static -mattr=+noabicalls -mgpopt | FileCheck %s +; RUN: llc < %s -march=mips -mcpu=mips32 -mips-ssection-threshold=8 \ +; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt \ +; RUN: | FileCheck %s --check-prefixes=BASIC,COMMON +; RUN: llc < %s -march=mips -mcpu=mips32 -mips-ssection-threshold=8 \ +; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt -membedded-data \ +; RUN: | FileCheck %s --check-prefixes=EMBDATA,COMMON + +; Test the layout of objects when compiling for static, noabicalls environment. %struct.anon = type { i32, i32 } +; BASIC: .type s0,@object +; BASIC-NEXT: .section .sdata,"aw",@progbits + +; EMDATA: .type s0,@object +; EMDATA-NEXT: .section .rodata,"a",@progbits + @s0 = constant [8 x i8] c"AAAAAAA\00", align 4 -; CHECK: .type foo,@object -; CHECK-NEXT: .section .sdata,"aw",@progbits +; BASIC: .type foo,@object +; BASIC-NOT: .section + +; EMBDATA: .type foo,@object +; EMBDATA-NEXT: .section .sdata,"aw",@progbits @foo = global %struct.anon { i32 2, i32 3 } -; CHECK: .type bar,@object -; CHECK-NEXT: .section .sbss,"aw",@nobits -@bar = global %struct.anon zeroinitializer +; COMMON: .type bar,@object +; COMMON-NEXT: .section .sbss,"aw",@nobits +@bar = global %struct.anon zeroinitializer define i8* @A0() nounwind { entry: |

