cl::Hidden, cl::ZeroOrMore, cl::init(false),
cl::desc("Enable Hexagon Vector print instr pass"));
+static cl::opt<bool> EnableTrapUnreachable("hexagon-trap-unreachable",
+ cl::Hidden, cl::ZeroOrMore, cl::init(false),
+ cl::desc("Enable generating trap for unreachable"));
+
/// HexagonTargetMachineModule - Note that this is used on hosts that
/// cannot link in a library unless there are references into the
/// library. In particular, it seems that it is not possible to get
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
getEffectiveCodeModel(CM), (HexagonNoOpt ? CodeGenOpt::None : OL)),
TLOF(make_unique<HexagonTargetObjectFile>()) {
+ if (EnableTrapUnreachable)
+ this->Options.TrapUnreachable = true;
initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
initAsmInfo();
}
--- /dev/null
+; RUN: llc -march=hexagon -hexagon-trap-unreachable < %s | FileCheck %s
+; CHECK: call abort
+
+define void @fred() #0 {
+ unreachable
+}
+
+attributes #0 = { nounwind }