#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/CodeGen/CommandFlags.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Linker/IRMover.h"
#include "llvm/Support/StringSaver.h"
const Target *T = TargetRegistry::lookupTarget(TripleStr, Msg);
if (!T)
fatal("target not found: " + Msg);
- TargetOptions Options;
+ TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
Reloc::Model R = Config->Pic ? Reloc::PIC_ : Reloc::Static;
return T->createTargetMachine(TripleStr, "", "", Options, R);
}
}
; The llvm.global_ctors should end up producing constructors.
-; CHECK: Name: .ctors
+; On x86-64 (linux) we should always emit .init_array and never .ctors.
+; CHECK: Name: .init_array
+; CHECK-NOT: Name: .ctors