Make sure -use-init-array has intended effect on all AArch64 ELF targets, not just linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kristof Beyls 2014-01-10 13:41:49 +00:00
parent 095f4c451c
commit ac843ff018
4 changed files with 8 additions and 11 deletions

View File

@ -31,12 +31,8 @@ using namespace llvm;
static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) {
const AArch64Subtarget *Subtarget = &TM.getSubtarget<AArch64Subtarget>();
if (Subtarget->isTargetLinux())
return new AArch64LinuxTargetObjectFile();
if (Subtarget->isTargetELF())
return new TargetLoweringObjectFileELF();
llvm_unreachable("unknown subtarget type");
assert (Subtarget->isTargetELF() && "unknown subtarget type");
return new AArch64ElfTargetObjectFile();
}
AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM)

View File

@ -17,8 +17,8 @@
using namespace llvm;
void
AArch64LinuxTargetObjectFile::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
InitializeELF(TM.Options.UseInitArray);
}

View File

@ -20,9 +20,9 @@
namespace llvm {
/// AArch64LinuxTargetObjectFile - This implementation is used for linux
/// AArch64.
class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF {
/// AArch64ElfTargetObjectFile - This implementation is used for ELF
/// AArch64 targets.
class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF {
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
};

View File

@ -1,4 +1,5 @@
; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -use-init-array < %s | FileCheck %s
; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -use-init-array < %s | FileCheck %s
define internal void @_GLOBAL__I_a() section ".text.startup" {
ret void